foundation-0.0.3: Alternative prelude with batteries and no dependencies

License | BSD-style
Maintainer | Vincent Hanquez <vincent@snarc.org>
Stability | experimental
Portability | portable
Safe Haskell | None
Language | Haskell2010

Foundation.Array

Description

Simple Array and Almost-Array-like data structure

Generally accessible in o(1)

Synopsis

- data Array a
- data MArray a st
- data UArray ty
- data MUArray ty st
- data ChunkedUArray ty
- data Bitmap
- data MutableBitmap st
- class Eq ty => PrimType ty
- data OutOfBound

# Documentation

data Array a #

Array of a

Instances

Functor Array # |
Methods fmap :: (a -> b) -> Array a -> Array b # (<$) :: a -> Array b -> Array a #
IsList (Array ty) # |
Associated Types type Item (Array ty) :: * # Methods fromList :: [Item (Array ty)] -> Array ty # fromListN :: Int -> [Item (Array ty)] -> Array ty # toList :: Array ty -> [Item (Array ty)] #
Eq a => Eq (Array a) # |
Methods (==) :: Array a -> Array a -> Bool # (/=) :: Array a -> Array a -> Bool #
Data ty => Data (Array ty) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> Array ty -> c (Array ty) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (Array ty) # toConstr :: Array ty -> Constr # dataTypeOf :: Array ty -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (Array ty)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (Array ty)) # gmapT :: (forall b. Data b => b -> b) -> Array ty -> Array ty # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> Array ty -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> Array ty -> r # gmapQ :: (forall d. Data d => d -> u) -> Array ty -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> Array ty -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> Array ty -> m (Array ty) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> Array ty -> m (Array ty) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> Array ty -> m (Array ty) #
Ord a => Ord (Array a) # |
Methods compare :: Array a -> Array a -> Ordering # (<) :: Array a -> Array a -> Bool # (<=) :: Array a -> Array a -> Bool # (>) :: Array a -> Array a -> Bool # (>=) :: Array a -> Array a -> Bool # max :: Array a -> Array a -> Array a # min :: Array a -> Array a -> Array a #
Show a => Show (Array a) # |
Methods showsPrec :: Int -> Array a -> ShowS # show :: Array a -> String # showList :: [Array a] -> ShowS #
Monoid (Array a) # |
Methods mempty :: Array a # mappend :: Array a -> Array a -> Array a # mconcat :: [Array a] -> Array a #
Buildable (Array ty) # |
Associated Types type Mutable (Array ty) :: * -> * # type Step (Array ty) :: * # Methods append :: PrimMonad prim => Element (Array ty) -> Builder (Array ty) prim () # build :: PrimMonad prim => Int -> Builder (Array ty) prim () -> prim (Array ty) #
Foldable (Array ty) # |
Methods foldl :: (a -> Element (Array ty) -> a) -> a -> Array ty -> a # foldl' :: (a -> Element (Array ty) -> a) -> a -> Array ty -> a # foldr :: (Element (Array ty) -> a -> a) -> a -> Array ty -> a # foldr' :: (Element (Array ty) -> a -> a) -> a -> Array ty -> a #
IndexedCollection (Array ty) # |
Methods (!) :: Array ty -> Int -> Maybe (Element (Array ty)) # findIndex :: (Element (Array ty) -> Bool) -> Array ty -> Maybe Int #
InnerFunctor (Array ty) # |
Methods imap :: (Element (Array ty) -> Element (Array ty)) -> Array ty -> Array ty #
Collection (Array ty) # |
Methods null :: Array ty -> Bool # length :: Array ty -> Int # elem :: (Eq a, (* ~ a) (Element (Array ty))) => Element (Array ty) -> Array ty -> Bool # notElem :: (Eq a, (* ~ a) (Element (Array ty))) => Element (Array ty) -> Array ty -> Bool # maximum :: (Ord a, (* ~ a) (Element (Array ty))) => NonEmpty (Array ty) -> Element (Array ty) # minimum :: (Ord a, (* ~ a) (Element (Array ty))) => NonEmpty (Array ty) -> Element (Array ty) #
Sequential (Array ty) # |
Methods take :: Int -> Array ty -> Array ty # revTake :: Int -> Array ty -> Array ty # drop :: Int -> Array ty -> Array ty # revDrop :: Int -> Array ty -> Array ty # splitAt :: Int -> Array ty -> (Array ty, Array ty) # revSplitAt :: Int -> Array ty -> (Array ty, Array ty) # splitOn :: (Element (Array ty) -> Bool) -> Array ty -> [Array ty] # break :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # breakElem :: Element (Array ty) -> Array ty -> (Array ty, Array ty) # intersperse :: Element (Array ty) -> Array ty -> Array ty # intercalate :: Element (Array ty) -> Array ty -> Element (Array ty) # span :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # filter :: (Element (Array ty) -> Bool) -> Array ty -> Array ty # partition :: (Element (Array ty) -> Bool) -> Array ty -> (Array ty, Array ty) # reverse :: Array ty -> Array ty # uncons :: Array ty -> Maybe (Element (Array ty), Array ty) # unsnoc :: Array ty -> Maybe (Array ty, Element (Array ty)) # snoc :: Array ty -> Element (Array ty) -> Array ty # cons :: Element (Array ty) -> Array ty -> Array ty # find :: (Element (Array ty) -> Bool) -> Array ty -> Maybe (Element (Array ty)) # sortBy :: (Element (Array ty) -> Element (Array ty) -> Ordering) -> Array ty -> Array ty # singleton :: Element (Array ty) -> Array ty # head :: NonEmpty (Array ty) -> Element (Array ty) # last :: NonEmpty (Array ty) -> Element (Array ty) # tail :: NonEmpty (Array ty) -> Array ty # init :: NonEmpty (Array ty) -> Array ty # isPrefixOf :: Array ty -> Array ty -> Bool # isSuffixOf :: Array ty -> Array ty -> Bool #
BoxedZippable (Array ty) # |
Methods zip :: (Sequential a, Sequential b, (* ~ Element (Array ty)) (Element a, Element b)) => a -> b -> Array ty # zip3 :: (Sequential a, Sequential b, Sequential c, (* ~ Element (Array ty)) (Element a, Element b, Element c)) => a -> b -> c -> Array ty # zip4 :: (Sequential a, Sequential b, Sequential c, Sequential d, (* ~ Element (Array ty)) (Element a, Element b, Element c, Element d)) => a -> b -> c -> d -> Array ty # zip5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, (* ~ Element (Array ty)) (Element a, Element b, Element c, Element d, Element e)) => a -> b -> c -> d -> e -> Array ty # zip6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, (* ~ Element (Array ty)) (Element a, Element b, Element c, Element d, Element e, Element f)) => a -> b -> c -> d -> e -> f -> Array ty # zip7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, (* ~ Element (Array ty)) (Element a, Element b, Element c, Element d, Element e, Element f, Element g)) => a -> b -> c -> d -> e -> f -> g -> Array ty # unzip :: (Sequential a, Sequential b, (* ~ Element (Array ty)) (Element a, Element b)) => Array ty -> (a, b) # unzip3 :: (Sequential a, Sequential b, Sequential c, (* ~ Element (Array ty)) (Element a, Element b, Element c)) => Array ty -> (a, b, c) # unzip4 :: (Sequential a, Sequential b, Sequential c, Sequential d, (* ~ Element (Array ty)) (Element a, Element b, Element c, Element d)) => Array ty -> (a, b, c, d) # unzip5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, (* ~ Element (Array ty)) (Element a, Element b, Element c, Element d, Element e)) => Array ty -> (a, b, c, d, e) # unzip6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, (* ~ Element (Array ty)) (Element a, Element b, Element c, Element d, Element e, Element f)) => Array ty -> (a, b, c, d, e, f) # unzip7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g, (* ~ Element (Array ty)) (Element a, Element b, Element c, Element d, Element e, Element f, Element g)) => Array ty -> (a, b, c, d, e, f, g) #
Zippable (Array ty) # |
Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element (Array ty)) -> a -> b -> Array ty # zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element (Array ty)) -> a -> b -> c -> Array ty # zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element (Array ty)) -> a -> b -> c -> d -> Array ty # zipWith5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element (Array ty)) -> a -> b -> c -> d -> e -> Array ty # zipWith6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element (Array ty)) -> a -> b -> c -> d -> e -> f -> Array ty # zipWith7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element g -> Element (Array ty)) -> a -> b -> c -> d -> e -> f -> g -> Array ty #
type Item (Array ty) # |
type Item (Array ty) = ty
type Element (Array ty) # |
type Element (Array ty) = ty
type Mutable (Array ty) # |
type Mutable (Array ty) = MArray ty
type Step (Array ty) # |
type Step (Array ty) = ty

data MArray a st #

Mutable Array of a

Instances

MutableCollection (MArray ty) # |
Associated Types type MutableFreezed (MArray ty :: * -> *) :: * # type MutableKey (MArray ty :: * -> *) :: * # type MutableValue (MArray ty :: * -> *) :: * # Methods unsafeThaw :: PrimMonad prim => MutableFreezed (MArray ty) -> prim (MArray ty (PrimState prim)) # unsafeFreeze :: PrimMonad prim => MArray ty (PrimState prim) -> prim (MutableFreezed (MArray ty)) # thaw :: PrimMonad prim => MutableFreezed (MArray ty) -> prim (MArray ty (PrimState prim)) # freeze :: PrimMonad prim => MArray ty (PrimState prim) -> prim (MutableFreezed (MArray ty)) # mutNew :: PrimMonad prim => Int -> prim (MArray ty (PrimState prim)) # mutUnsafeWrite :: PrimMonad prim => MArray ty (PrimState prim) -> MutableKey (MArray ty) -> MutableValue (MArray ty) -> prim () # mutWrite :: PrimMonad prim => MArray ty (PrimState prim) -> MutableKey (MArray ty) -> MutableValue (MArray ty) -> prim () # mutUnsafeRead :: PrimMonad prim => MArray ty (PrimState prim) -> MutableKey (MArray ty) -> prim (MutableValue (MArray ty)) # mutRead :: PrimMonad prim => MArray ty (PrimState prim) -> MutableKey (MArray ty) -> prim (MutableValue (MArray ty)) #
type MutableFreezed (MArray ty) # |
type MutableFreezed (MArray ty) = Array ty
type MutableKey (MArray ty) # |
type MutableKey (MArray ty) = Int
type MutableValue (MArray ty) # |
type MutableValue (MArray ty) = ty

data UArray ty #

An array of type built on top of GHC primitive.

The elements need to have fixed sized and the representation is a packed contiguous array in memory that can easily be passed to foreign interface

Instances

PrimType ty => IsList (UArray ty) # |
Associated Types type Item (UArray ty) :: * # Methods fromList :: [Item (UArray ty)] -> UArray ty # fromListN :: Int -> [Item (UArray ty)] -> UArray ty # toList :: UArray ty -> [Item (UArray ty)] #
(PrimType ty, Eq ty) => Eq (UArray ty) # |
Methods (==) :: UArray ty -> UArray ty -> Bool # (/=) :: UArray ty -> UArray ty -> Bool #
Data ty => Data (UArray ty) # |
Methods gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> UArray ty -> c (UArray ty) # gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (UArray ty) # toConstr :: UArray ty -> Constr # dataTypeOf :: UArray ty -> DataType # dataCast1 :: Typeable (* -> *) t => (forall d. Data d => c (t d)) -> Maybe (c (UArray ty)) # dataCast2 :: Typeable (* -> * -> *) t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (UArray ty)) # gmapT :: (forall b. Data b => b -> b) -> UArray ty -> UArray ty # gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> UArray ty -> r # gmapQr :: (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> UArray ty -> r # gmapQ :: (forall d. Data d => d -> u) -> UArray ty -> [u] # gmapQi :: Int -> (forall d. Data d => d -> u) -> UArray ty -> u # gmapM :: Monad m => (forall d. Data d => d -> m d) -> UArray ty -> m (UArray ty) # gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> UArray ty -> m (UArray ty) # gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> UArray ty -> m (UArray ty) #
(PrimType ty, Ord ty) => Ord (UArray ty) # |
Methods compare :: UArray ty -> UArray ty -> Ordering # (<) :: UArray ty -> UArray ty -> Bool # (<=) :: UArray ty -> UArray ty -> Bool # (>) :: UArray ty -> UArray ty -> Bool # (>=) :: UArray ty -> UArray ty -> Bool # max :: UArray ty -> UArray ty -> UArray ty # min :: UArray ty -> UArray ty -> UArray ty #
(PrimType ty, Show ty) => Show (UArray ty) # |
Methods showsPrec :: Int -> UArray ty -> ShowS # show :: UArray ty -> String # showList :: [UArray ty] -> ShowS #
PrimType ty => Monoid (UArray ty) # |
Methods mempty :: UArray ty # mappend :: UArray ty -> UArray ty -> UArray ty # mconcat :: [UArray ty] -> UArray ty #
PrimType ty => Buildable (UArray ty) # |
Associated Types type Mutable (UArray ty) :: * -> * # type Step (UArray ty) :: * # Methods append :: PrimMonad prim => Element (UArray ty) -> Builder (UArray ty) prim () # build :: PrimMonad prim => Int -> Builder (UArray ty) prim () -> prim (UArray ty) #
PrimType ty => Foldable (UArray ty) # |
Methods foldl :: (a -> Element (UArray ty) -> a) -> a -> UArray ty -> a # foldl' :: (a -> Element (UArray ty) -> a) -> a -> UArray ty -> a # foldr :: (Element (UArray ty) -> a -> a) -> a -> UArray ty -> a # foldr' :: (Element (UArray ty) -> a -> a) -> a -> UArray ty -> a #
PrimType ty => IndexedCollection (UArray ty) # |
Methods (!) :: UArray ty -> Int -> Maybe (Element (UArray ty)) # findIndex :: (Element (UArray ty) -> Bool) -> UArray ty -> Maybe Int #
PrimType ty => InnerFunctor (UArray ty) # |
Methods imap :: (Element (UArray ty) -> Element (UArray ty)) -> UArray ty -> UArray ty #
PrimType ty => Collection (UArray ty) # |
Methods null :: UArray ty -> Bool # length :: UArray ty -> Int # elem :: (Eq a, (* ~ a) (Element (UArray ty))) => Element (UArray ty) -> UArray ty -> Bool # notElem :: (Eq a, (* ~ a) (Element (UArray ty))) => Element (UArray ty) -> UArray ty -> Bool # maximum :: (Ord a, (* ~ a) (Element (UArray ty))) => NonEmpty (UArray ty) -> Element (UArray ty) # minimum :: (Ord a, (* ~ a) (Element (UArray ty))) => NonEmpty (UArray ty) -> Element (UArray ty) #
PrimType ty => Sequential (UArray ty) # |
Methods take :: Int -> UArray ty -> UArray ty # revTake :: Int -> UArray ty -> UArray ty # drop :: Int -> UArray ty -> UArray ty # revDrop :: Int -> UArray ty -> UArray ty # splitAt :: Int -> UArray ty -> (UArray ty, UArray ty) # revSplitAt :: Int -> UArray ty -> (UArray ty, UArray ty) # splitOn :: (Element (UArray ty) -> Bool) -> UArray ty -> [UArray ty] # break :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # breakElem :: Element (UArray ty) -> UArray ty -> (UArray ty, UArray ty) # intersperse :: Element (UArray ty) -> UArray ty -> UArray ty # intercalate :: Element (UArray ty) -> UArray ty -> Element (UArray ty) # span :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # filter :: (Element (UArray ty) -> Bool) -> UArray ty -> UArray ty # partition :: (Element (UArray ty) -> Bool) -> UArray ty -> (UArray ty, UArray ty) # reverse :: UArray ty -> UArray ty # uncons :: UArray ty -> Maybe (Element (UArray ty), UArray ty) # unsnoc :: UArray ty -> Maybe (UArray ty, Element (UArray ty)) # snoc :: UArray ty -> Element (UArray ty) -> UArray ty # cons :: Element (UArray ty) -> UArray ty -> UArray ty # find :: (Element (UArray ty) -> Bool) -> UArray ty -> Maybe (Element (UArray ty)) # sortBy :: (Element (UArray ty) -> Element (UArray ty) -> Ordering) -> UArray ty -> UArray ty # singleton :: Element (UArray ty) -> UArray ty # head :: NonEmpty (UArray ty) -> Element (UArray ty) # last :: NonEmpty (UArray ty) -> Element (UArray ty) # tail :: NonEmpty (UArray ty) -> UArray ty # init :: NonEmpty (UArray ty) -> UArray ty # isPrefixOf :: UArray ty -> UArray ty -> Bool # isSuffixOf :: UArray ty -> UArray ty -> Bool #
PrimType ty => Zippable (UArray ty) # |
Methods zipWith :: (Sequential a, Sequential b) => (Element a -> Element b -> Element (UArray ty)) -> a -> b -> UArray ty # zipWith3 :: (Sequential a, Sequential b, Sequential c) => (Element a -> Element b -> Element c -> Element (UArray ty)) -> a -> b -> c -> UArray ty # zipWith4 :: (Sequential a, Sequential b, Sequential c, Sequential d) => (Element a -> Element b -> Element c -> Element d -> Element (UArray ty)) -> a -> b -> c -> d -> UArray ty # zipWith5 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element (UArray ty)) -> a -> b -> c -> d -> e -> UArray ty # zipWith6 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element (UArray ty)) -> a -> b -> c -> d -> e -> f -> UArray ty # zipWith7 :: (Sequential a, Sequential b, Sequential c, Sequential d, Sequential e, Sequential f, Sequential g) => (Element a -> Element b -> Element c -> Element d -> Element e -> Element f -> Element g -> Element (UArray ty)) -> a -> b -> c -> d -> e -> f -> g -> UArray ty #
PrimType a => Hashable (UArray a) # |
Methods hashMix :: Hasher st => UArray a -> st -> st #
type Item (UArray ty) # |
type Item (UArray ty) = ty
type Element (UArray ty) # |
type Element (UArray ty) = ty
type Mutable (UArray ty) # |
type Mutable (UArray ty) = MUArray ty
type Step (UArray ty) # |
type Step (UArray ty) = ty

data MUArray ty st #

A Mutable array of types built on top of GHC primitive.

Element in this array can be modified in place.

Instances

PrimType ty => MutableCollection (MUArray ty) # |
Associated Types type MutableFreezed (MUArray ty :: * -> *) :: * # type MutableKey (MUArray ty :: * -> *) :: * # type MutableValue (MUArray ty :: * -> *) :: * # Methods unsafeThaw :: PrimMonad prim => MutableFreezed (MUArray ty) -> prim (MUArray ty (PrimState prim)) # unsafeFreeze :: PrimMonad prim => MUArray ty (PrimState prim) -> prim (MutableFreezed (MUArray ty)) # thaw :: PrimMonad prim => MutableFreezed (MUArray ty) -> prim (MUArray ty (PrimState prim)) # freeze :: PrimMonad prim => MUArray ty (PrimState prim) -> prim (MutableFreezed (MUArray ty)) # mutNew :: PrimMonad prim => Int -> prim (MUArray ty (PrimState prim)) # mutUnsafeWrite :: PrimMonad prim => MUArray ty (PrimState prim) -> MutableKey (MUArray ty) -> MutableValue (MUArray ty) -> prim () # mutWrite :: PrimMonad prim => MUArray ty (PrimState prim) -> MutableKey (MUArray ty) -> MutableValue (MUArray ty) -> prim () # mutUnsafeRead :: PrimMonad prim => MUArray ty (PrimState prim) -> MutableKey (MUArray ty) -> prim (MutableValue (MUArray ty)) # mutRead :: PrimMonad prim => MUArray ty (PrimState prim) -> MutableKey (MUArray ty) -> prim (MutableValue (MUArray ty)) #
type MutableFreezed (MUArray ty) # |
type MutableFreezed (MUArray ty) = UArray ty
type MutableKey (MUArray ty) # |
type MutableKey (MUArray ty) = Int
type MutableValue (MUArray ty) # |
type MutableValue (MUArray ty) = ty

data ChunkedUArray ty #

Instances

PrimType ty => IsList (ChunkedUArray ty) # |
Associated Types type Item (ChunkedUArray ty) :: * # Methods fromList :: [Item (ChunkedUArray ty)] -> ChunkedUArray ty # fromListN :: Int -> [Item (ChunkedUArray ty)] -> ChunkedUArray ty # toList :: ChunkedUArray ty -> [Item (ChunkedUArray ty)] #
PrimType ty => Eq (ChunkedUArray ty) # |
Methods (==) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # (/=) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool #
(Ord ty, PrimType ty) => Ord (ChunkedUArray ty) # |
Methods compare :: ChunkedUArray ty -> ChunkedUArray ty -> Ordering # (<) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # (<=) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # (>) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # (>=) :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # max :: ChunkedUArray ty -> ChunkedUArray ty -> ChunkedUArray ty # min :: ChunkedUArray ty -> ChunkedUArray ty -> ChunkedUArray ty #
(Show ty, PrimType ty) => Show (ChunkedUArray ty) # |
Methods showsPrec :: Int -> ChunkedUArray ty -> ShowS # show :: ChunkedUArray ty -> String # showList :: [ChunkedUArray ty] -> ShowS #
Monoid (ChunkedUArray a) # |
Methods mempty :: ChunkedUArray a # mappend :: ChunkedUArray a -> ChunkedUArray a -> ChunkedUArray a # mconcat :: [ChunkedUArray a] -> ChunkedUArray a #
PrimType ty => IndexedCollection (ChunkedUArray ty) # |
Methods (!) :: ChunkedUArray ty -> Int -> Maybe (Element (ChunkedUArray ty)) # findIndex :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> Maybe Int #
PrimType ty => Collection (ChunkedUArray ty) # |
Methods null :: ChunkedUArray ty -> Bool # length :: ChunkedUArray ty -> Int # elem :: (Eq a, (* ~ a) (Element (ChunkedUArray ty))) => Element (ChunkedUArray ty) -> ChunkedUArray ty -> Bool # notElem :: (Eq a, (* ~ a) (Element (ChunkedUArray ty))) => Element (ChunkedUArray ty) -> ChunkedUArray ty -> Bool # maximum :: (Ord a, (* ~ a) (Element (ChunkedUArray ty))) => NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) # minimum :: (Ord a, (* ~ a) (Element (ChunkedUArray ty))) => NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) #
PrimType ty => Sequential (ChunkedUArray ty) # |
Methods take :: Int -> ChunkedUArray ty -> ChunkedUArray ty # revTake :: Int -> ChunkedUArray ty -> ChunkedUArray ty # drop :: Int -> ChunkedUArray ty -> ChunkedUArray ty # revDrop :: Int -> ChunkedUArray ty -> ChunkedUArray ty # splitAt :: Int -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # revSplitAt :: Int -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # splitOn :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> [ChunkedUArray ty] # break :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # breakElem :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # intersperse :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> ChunkedUArray ty # intercalate :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> Element (ChunkedUArray ty) # span :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # filter :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> ChunkedUArray ty # partition :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> (ChunkedUArray ty, ChunkedUArray ty) # reverse :: ChunkedUArray ty -> ChunkedUArray ty # uncons :: ChunkedUArray ty -> Maybe (Element (ChunkedUArray ty), ChunkedUArray ty) # unsnoc :: ChunkedUArray ty -> Maybe (ChunkedUArray ty, Element (ChunkedUArray ty)) # snoc :: ChunkedUArray ty -> Element (ChunkedUArray ty) -> ChunkedUArray ty # cons :: Element (ChunkedUArray ty) -> ChunkedUArray ty -> ChunkedUArray ty # find :: (Element (ChunkedUArray ty) -> Bool) -> ChunkedUArray ty -> Maybe (Element (ChunkedUArray ty)) # sortBy :: (Element (ChunkedUArray ty) -> Element (ChunkedUArray ty) -> Ordering) -> ChunkedUArray ty -> ChunkedUArray ty # singleton :: Element (ChunkedUArray ty) -> ChunkedUArray ty # head :: NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) # last :: NonEmpty (ChunkedUArray ty) -> Element (ChunkedUArray ty) # tail :: NonEmpty (ChunkedUArray ty) -> ChunkedUArray ty # init :: NonEmpty (ChunkedUArray ty) -> ChunkedUArray ty # isPrefixOf :: ChunkedUArray ty -> ChunkedUArray ty -> Bool # isSuffixOf :: ChunkedUArray ty -> ChunkedUArray ty -> Bool #
type Item (ChunkedUArray ty) # |
type Item (ChunkedUArray ty) = ty
type Element (ChunkedUArray ty) # |
type Element (ChunkedUArray ty) = ty

data Bitmap #

Instances

IsList Bitmap # |
Associated Types type Item Bitmap :: * # Methods fromList :: [Item Bitmap] -> Bitmap # fromListN :: Int -> [Item Bitmap] -> Bitmap # toList :: Bitmap -> [Item Bitmap] #
Eq Bitmap # |
Methods (==) :: Bitmap -> Bitmap -> Bool # (/=) :: Bitmap -> Bitmap -> Bool #
Ord Bitmap # |
Methods compare :: Bitmap -> Bitmap -> Ordering # (<) :: Bitmap -> Bitmap -> Bool # (<=) :: Bitmap -> Bitmap -> Bool # (>) :: Bitmap -> Bitmap -> Bool # (>=) :: Bitmap -> Bitmap -> Bool # max :: Bitmap -> Bitmap -> Bitmap # min :: Bitmap -> Bitmap -> Bitmap #
Show Bitmap # |
Methods showsPrec :: Int -> Bitmap -> ShowS # show :: Bitmap -> String # showList :: [Bitmap] -> ShowS #
Monoid Bitmap # |
Methods mempty :: Bitmap # mappend :: Bitmap -> Bitmap -> Bitmap # mconcat :: [Bitmap] -> Bitmap #
Foldable Bitmap # |
Methods foldl :: (a -> Element Bitmap -> a) -> a -> Bitmap -> a # foldl' :: (a -> Element Bitmap -> a) -> a -> Bitmap -> a # foldr :: (Element Bitmap -> a -> a) -> a -> Bitmap -> a # foldr' :: (Element Bitmap -> a -> a) -> a -> Bitmap -> a #
IndexedCollection Bitmap # |
Methods (!) :: Bitmap -> Int -> Maybe (Element Bitmap) # findIndex :: (Element Bitmap -> Bool) -> Bitmap -> Maybe Int #
InnerFunctor Bitmap # |
Methods imap :: (Element Bitmap -> Element Bitmap) -> Bitmap -> Bitmap #
Collection Bitmap # |
Methods null :: Bitmap -> Bool # length :: Bitmap -> Int # elem :: (Eq a, (* ~ a) (Element Bitmap)) => Element Bitmap -> Bitmap -> Bool # notElem :: (Eq a, (* ~ a) (Element Bitmap)) => Element Bitmap -> Bitmap -> Bool # maximum :: (Ord a, (* ~ a) (Element Bitmap)) => NonEmpty Bitmap -> Element Bitmap # minimum :: (Ord a, (* ~ a) (Element Bitmap)) => NonEmpty Bitmap -> Element Bitmap #
Sequential Bitmap # |
Methods take :: Int -> Bitmap -> Bitmap # revTake :: Int -> Bitmap -> Bitmap # drop :: Int -> Bitmap -> Bitmap # revDrop :: Int -> Bitmap -> Bitmap # splitAt :: Int -> Bitmap -> (Bitmap, Bitmap) # revSplitAt :: Int -> Bitmap -> (Bitmap, Bitmap) # splitOn :: (Element Bitmap -> Bool) -> Bitmap -> [Bitmap] # break :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # breakElem :: Element Bitmap -> Bitmap -> (Bitmap, Bitmap) # intersperse :: Element Bitmap -> Bitmap -> Bitmap # intercalate :: Element Bitmap -> Bitmap -> Element Bitmap # span :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # filter :: (Element Bitmap -> Bool) -> Bitmap -> Bitmap # partition :: (Element Bitmap -> Bool) -> Bitmap -> (Bitmap, Bitmap) # reverse :: Bitmap -> Bitmap # uncons :: Bitmap -> Maybe (Element Bitmap, Bitmap) # unsnoc :: Bitmap -> Maybe (Bitmap, Element Bitmap) # snoc :: Bitmap -> Element Bitmap -> Bitmap # cons :: Element Bitmap -> Bitmap -> Bitmap # find :: (Element Bitmap -> Bool) -> Bitmap -> Maybe (Element Bitmap) # sortBy :: (Element Bitmap -> Element Bitmap -> Ordering) -> Bitmap -> Bitmap # singleton :: Element Bitmap -> Bitmap # head :: NonEmpty Bitmap -> Element Bitmap # last :: NonEmpty Bitmap -> Element Bitmap # tail :: NonEmpty Bitmap -> Bitmap # init :: NonEmpty Bitmap -> Bitmap # isPrefixOf :: Bitmap -> Bitmap -> Bool # isSuffixOf :: Bitmap -> Bitmap -> Bool #
type Item Bitmap # |
type Item Bitmap = Bool
type Element Bitmap # |
type Element Bitmap = Bool

data MutableBitmap st #

Instances

MutableCollection MutableBitmap # |
Associated Types type MutableFreezed (MutableBitmap :: * -> *) :: * # type MutableKey (MutableBitmap :: * -> *) :: * # type MutableValue (MutableBitmap :: * -> *) :: * # Methods unsafeThaw :: PrimMonad prim => MutableFreezed MutableBitmap -> prim (MutableBitmap (PrimState prim)) # unsafeFreeze :: PrimMonad prim => MutableBitmap (PrimState prim) -> prim (MutableFreezed MutableBitmap) # thaw :: PrimMonad prim => MutableFreezed MutableBitmap -> prim (MutableBitmap (PrimState prim)) # freeze :: PrimMonad prim => MutableBitmap (PrimState prim) -> prim (MutableFreezed MutableBitmap) # mutNew :: PrimMonad prim => Int -> prim (MutableBitmap (PrimState prim)) # mutUnsafeWrite :: PrimMonad prim => MutableBitmap (PrimState prim) -> MutableKey MutableBitmap -> MutableValue MutableBitmap -> prim () # mutWrite :: PrimMonad prim => MutableBitmap (PrimState prim) -> MutableKey MutableBitmap -> MutableValue MutableBitmap -> prim () # mutUnsafeRead :: PrimMonad prim => MutableBitmap (PrimState prim) -> MutableKey MutableBitmap -> prim (MutableValue MutableBitmap) # mutRead :: PrimMonad prim => MutableBitmap (PrimState prim) -> MutableKey MutableBitmap -> prim (MutableValue MutableBitmap) #
type MutableFreezed MutableBitmap # |
type MutableFreezed MutableBitmap = Bitmap
type MutableKey MutableBitmap # |
type MutableKey MutableBitmap = Int
type MutableValue MutableBitmap # |
type MutableValue MutableBitmap = Bool

class Eq ty => PrimType ty #

Represent the accessor for types that can be stored in the UArray and MUArray.

Types need to be a instance of storable and have fixed sized.

Minimal complete definition

primSizeInBytes, primBaUIndex, primMbaURead, primMbaUWrite, primAddrIndex, primAddrRead, primAddrWrite

Instances

PrimType Char # |
Methods primSizeInBytes :: Proxy * Char -> Size8 # primBaUIndex :: ByteArray# -> Offset Char -> Char # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char -> prim Char # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Char -> Char -> prim () # primAddrIndex :: Addr# -> Offset Char -> Char # primAddrRead :: PrimMonad prim => Addr# -> Offset Char -> prim Char # primAddrWrite :: PrimMonad prim => Addr# -> Offset Char -> Char -> prim () #
PrimType Double # |
Methods primSizeInBytes :: Proxy * Double -> Size8 # primBaUIndex :: ByteArray# -> Offset Double -> Double # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Double -> prim Double # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Double -> Double -> prim () # primAddrIndex :: Addr# -> Offset Double -> Double # primAddrRead :: PrimMonad prim => Addr# -> Offset Double -> prim Double # primAddrWrite :: PrimMonad prim => Addr# -> Offset Double -> Double -> prim () #
PrimType Float # |
Methods primSizeInBytes :: Proxy * Float -> Size8 # primBaUIndex :: ByteArray# -> Offset Float -> Float # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Float -> prim Float # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Float -> Float -> prim () # primAddrIndex :: Addr# -> Offset Float -> Float # primAddrRead :: PrimMonad prim => Addr# -> Offset Float -> prim Float # primAddrWrite :: PrimMonad prim => Addr# -> Offset Float -> Float -> prim () #
PrimType Int8 # |
Methods primSizeInBytes :: Proxy * Int8 -> Size8 # primBaUIndex :: ByteArray# -> Offset Int8 -> Int8 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int8 -> prim Int8 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int8 -> Int8 -> prim () # primAddrIndex :: Addr# -> Offset Int8 -> Int8 # primAddrRead :: PrimMonad prim => Addr# -> Offset Int8 -> prim Int8 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int8 -> Int8 -> prim () #
PrimType Int16 # |
Methods primSizeInBytes :: Proxy * Int16 -> Size8 # primBaUIndex :: ByteArray# -> Offset Int16 -> Int16 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int16 -> prim Int16 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int16 -> Int16 -> prim () # primAddrIndex :: Addr# -> Offset Int16 -> Int16 # primAddrRead :: PrimMonad prim => Addr# -> Offset Int16 -> prim Int16 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int16 -> Int16 -> prim () #
PrimType Int32 # |
Methods primSizeInBytes :: Proxy * Int32 -> Size8 # primBaUIndex :: ByteArray# -> Offset Int32 -> Int32 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int32 -> prim Int32 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int32 -> Int32 -> prim () # primAddrIndex :: Addr# -> Offset Int32 -> Int32 # primAddrRead :: PrimMonad prim => Addr# -> Offset Int32 -> prim Int32 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int32 -> Int32 -> prim () #
PrimType Int64 # |
Methods primSizeInBytes :: Proxy * Int64 -> Size8 # primBaUIndex :: ByteArray# -> Offset Int64 -> Int64 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int64 -> prim Int64 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Int64 -> Int64 -> prim () # primAddrIndex :: Addr# -> Offset Int64 -> Int64 # primAddrRead :: PrimMonad prim => Addr# -> Offset Int64 -> prim Int64 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Int64 -> Int64 -> prim () #
PrimType Word8 # |
Methods primSizeInBytes :: Proxy * Word8 -> Size8 # primBaUIndex :: ByteArray# -> Offset Word8 -> Word8 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word8 -> prim Word8 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word8 -> Word8 -> prim () # primAddrIndex :: Addr# -> Offset Word8 -> Word8 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word8 -> prim Word8 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word8 -> Word8 -> prim () #
PrimType Word16 # |
Methods primSizeInBytes :: Proxy * Word16 -> Size8 # primBaUIndex :: ByteArray# -> Offset Word16 -> Word16 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word16 -> prim Word16 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word16 -> Word16 -> prim () # primAddrIndex :: Addr# -> Offset Word16 -> Word16 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word16 -> prim Word16 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word16 -> Word16 -> prim () #
PrimType Word32 # |
Methods primSizeInBytes :: Proxy * Word32 -> Size8 # primBaUIndex :: ByteArray# -> Offset Word32 -> Word32 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word32 -> prim Word32 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word32 -> Word32 -> prim () # primAddrIndex :: Addr# -> Offset Word32 -> Word32 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word32 -> prim Word32 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word32 -> Word32 -> prim () #
PrimType Word64 # |
Methods primSizeInBytes :: Proxy * Word64 -> Size8 # primBaUIndex :: ByteArray# -> Offset Word64 -> Word64 # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word64 -> prim Word64 # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset Word64 -> Word64 -> prim () # primAddrIndex :: Addr# -> Offset Word64 -> Word64 # primAddrRead :: PrimMonad prim => Addr# -> Offset Word64 -> prim Word64 # primAddrWrite :: PrimMonad prim => Addr# -> Offset Word64 -> Word64 -> prim () #
PrimType CChar # |
Methods primSizeInBytes :: Proxy * CChar -> Size8 # primBaUIndex :: ByteArray# -> Offset CChar -> CChar # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CChar -> prim CChar # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CChar -> CChar -> prim () # primAddrIndex :: Addr# -> Offset CChar -> CChar # primAddrRead :: PrimMonad prim => Addr# -> Offset CChar -> prim CChar # primAddrWrite :: PrimMonad prim => Addr# -> Offset CChar -> CChar -> prim () #
PrimType CUChar # |
Methods primSizeInBytes :: Proxy * CUChar -> Size8 # primBaUIndex :: ByteArray# -> Offset CUChar -> CUChar # primMbaURead :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CUChar -> prim CUChar # primMbaUWrite :: PrimMonad prim => MutableByteArray# (PrimState prim) -> Offset CUChar -> CUChar -> prim () # primAddrIndex :: Addr# -> Offset CUChar -> CUChar # primAddrRead :: PrimMonad prim => Addr# -> Offset CUChar -> prim CUChar # primAddrWrite :: PrimMonad prim => Addr# -> Offset CUChar -> CUChar -> prim () #

data OutOfBound #

Exception during an operation accessing the vector out of bound

Represent the type of operation, the index accessed, and the total length of the vector.

Instances

Show OutOfBound # |
Methods showsPrec :: Int -> OutOfBound -> ShowS # show :: OutOfBound -> String # showList :: [OutOfBound] -> ShowS #
Exception OutOfBound # |
Methods toException :: OutOfBound -> SomeException # fromException :: SomeException -> Maybe OutOfBound # displayException :: OutOfBound -> String #