PrimitiveExtras.By6Bits

primitive-extras-0.10.2.1: Extras for the "primitive" library

Safe Haskell | None
Language | Haskell2010

PrimitiveExtras.By6Bits

Contents

- Orphan instances

Synopsis

- data By6Bits e
- empty :: By6Bits e
- singleton :: Int -> e -> By6Bits e
- maybeList :: [Maybe e] -> By6Bits e
- pair :: Int -> e -> Int -> e -> By6Bits e
- insert :: Int -> e -> By6Bits e -> By6Bits e
- replace :: Int -> e -> By6Bits e -> By6Bits e
- adjust :: (e -> e) -> Int -> By6Bits e -> By6Bits e
- unset :: Int -> By6Bits e -> By6Bits e
- lookup :: Int -> By6Bits e -> Maybe e
- focusAt :: Monad m => Focus a m b -> Int -> By6Bits a -> m (b, By6Bits a)
- toMaybeList :: By6Bits e -> [Maybe e]
- toIndexedList :: By6Bits e -> [(Int, e)]
- elementsUnfoldl :: By6Bits e -> Unfoldl e
- elementsUnfoldlM :: forall (m :: Type -> Type) a. Monad m => By6Bits a -> UnfoldlM m a
- elementsListT :: forall (m :: Type -> Type) a. Monad m => By6Bits a -> ListT m a
- onElementAtFocus :: forall (m :: Type -> Type) a b. Monad m => Int -> Focus a m b -> Focus (By6Bits a) m b
- null :: By6Bits a -> Bool

# Documentation

data By6Bits e #

An immutable space-efficient sparse array, which can only store not more than 64 elements.

#### Instances

Instances details

Foldable By6Bits # |
Instance details Defined in PrimitiveExtras.By6Bits Methods fold :: Monoid m => By6Bits m -> m # foldMap :: Monoid m => (a -> m) -> By6Bits a -> m # foldMap' :: Monoid m => (a -> m) -> By6Bits a -> m # foldr :: (a -> b -> b) -> b -> By6Bits a -> b # foldr' :: (a -> b -> b) -> b -> By6Bits a -> b # foldl :: (b -> a -> b) -> b -> By6Bits a -> b # foldl' :: (b -> a -> b) -> b -> By6Bits a -> b # foldr1 :: (a -> a -> a) -> By6Bits a -> a # foldl1 :: (a -> a -> a) -> By6Bits a -> a # toList :: By6Bits a -> [a] # null :: By6Bits a -> Bool # length :: By6Bits a -> Int # elem :: Eq a => a -> By6Bits a -> Bool # maximum :: Ord a => By6Bits a -> a # minimum :: Ord a => By6Bits a -> a # sum :: Num a => By6Bits a -> a # product :: Num a => By6Bits a -> a #
Show a => Show (By6Bits a) # |
Instance details Defined in PrimitiveExtras.By6Bits Methods showsPrec :: Int -> By6Bits a -> ShowS # show :: By6Bits a -> String # showList :: [By6Bits a] -> ShowS #
Eq a => Eq (By6Bits a) # |
Instance details Defined in PrimitiveExtras.By6Bits Methods (==) :: By6Bits a -> By6Bits a -> Bool # (/=) :: By6Bits a -> By6Bits a -> Bool #

empty :: By6Bits e #

singleton :: Int -> e -> By6Bits e #

An array with a single element at the specified index.

maybeList :: [Maybe e] -> By6Bits e #

pair :: Int -> e -> Int -> e -> By6Bits e #

insert :: Int -> e -> By6Bits e -> By6Bits e #

Insert an element value at the index. It's your obligation to ensure that the index is empty before the operation.

replace :: Int -> e -> By6Bits e -> By6Bits e #

adjust :: (e -> e) -> Int -> By6Bits e -> By6Bits e #

unset :: Int -> By6Bits e -> By6Bits e #

Remove an element.

lookup :: Int -> By6Bits e -> Maybe e #

Lookup an item at the index.

focusAt :: Monad m => Focus a m b -> Int -> By6Bits a -> m (b, By6Bits a) #

toMaybeList :: By6Bits e -> [Maybe e] #

Convert into a list representation.

toIndexedList :: By6Bits e -> [(Int, e)] #

elementsUnfoldl :: By6Bits e -> Unfoldl e #

elementsUnfoldlM :: forall (m :: Type -> Type) a. Monad m => By6Bits a -> UnfoldlM m a #

elementsListT :: forall (m :: Type -> Type) a. Monad m => By6Bits a -> ListT m a #

onElementAtFocus :: forall (m :: Type -> Type) a b. Monad m => Int -> Focus a m b -> Focus (By6Bits a) m b #

null :: By6Bits a -> Bool #

# Orphan instances

Foldable By6Bits # |
Instance details Methods fold :: Monoid m => By6Bits m -> m # foldMap :: Monoid m => (a -> m) -> By6Bits a -> m # foldMap' :: Monoid m => (a -> m) -> By6Bits a -> m # foldr :: (a -> b -> b) -> b -> By6Bits a -> b # foldr' :: (a -> b -> b) -> b -> By6Bits a -> b # foldl :: (b -> a -> b) -> b -> By6Bits a -> b # foldl' :: (b -> a -> b) -> b -> By6Bits a -> b # foldr1 :: (a -> a -> a) -> By6Bits a -> a # foldl1 :: (a -> a -> a) -> By6Bits a -> a # toList :: By6Bits a -> [a] # null :: By6Bits a -> Bool # length :: By6Bits a -> Int # elem :: Eq a => a -> By6Bits a -> Bool # maximum :: Ord a => By6Bits a -> a # minimum :: Ord a => By6Bits a -> a # sum :: Num a => By6Bits a -> a # product :: Num a => By6Bits a -> a #
Show a => Show (By6Bits a) # |
Instance details Methods showsPrec :: Int -> By6Bits a -> ShowS # show :: By6Bits a -> String # showList :: [By6Bits a] -> ShowS #
Eq a => Eq (By6Bits a) # |
Instance details Methods (==) :: By6Bits a -> By6Bits a -> Bool # (/=) :: By6Bits a -> By6Bits a -> Bool #