PrimitiveExtras.PrimMultiArray

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

Safe Haskell | None
Language | Haskell2010

PrimitiveExtras.PrimMultiArray

Contents

- Orphan instances

Synopsis

- data PrimMultiArray a
- create :: (Monad m, Prim element) => Int -> (forall x. Fold (Int, element) x -> m x) -> m (PrimMultiArray element)
- replicateM :: (Monad m, Prim a) => Int -> m (PrimArray a) -> m (PrimMultiArray a)
- outerLength :: PrimMultiArray a -> Int
- toAssocsUnfoldl :: Prim a => PrimMultiArray a -> Unfoldl (Int, a)
- toIndicesUnfoldl :: PrimMultiArray a -> Unfoldl Int
- toUnfoldlAt :: Prim prim => PrimMultiArray prim -> Int -> Unfoldl prim
- toAssocsUnfoldlM :: forall (m :: Type -> Type) a. (Monad m, Prim a) => PrimMultiArray a -> UnfoldlM m (Int, a)
- toIndicesUnfoldlM :: forall (m :: Type -> Type) a. Monad m => PrimMultiArray a -> UnfoldlM m Int
- toUnfoldlAtM :: forall (m :: Type -> Type) prim. (Monad m, Prim prim) => PrimMultiArray prim -> Int -> UnfoldlM m prim
- cerealGet :: Prim element => Get Int -> Get element -> Get (PrimMultiArray element)
- cerealGetAsInMemory :: Prim element => Get Int -> Get (PrimMultiArray element)
- cerealPut :: Prim element => Putter Int -> Putter element -> Putter (PrimMultiArray element)
- cerealPutAsInMemory :: Prim element => Putter Int -> Putter (PrimMultiArray element)
- fold :: (Integral size, Prim size, Prim element) => PrimArray size -> Fold (Int, element) (PrimMultiArray element)

# Documentation

data PrimMultiArray a #

#### Instances

Instances details

(Show a, Prim a) => Show (PrimMultiArray a) # |
Instance details Defined in PrimitiveExtras.PrimMultiArray Methods showsPrec :: Int -> PrimMultiArray a -> ShowS # show :: PrimMultiArray a -> String # showList :: [PrimMultiArray a] -> ShowS #
(Eq a, Prim a) => Eq (PrimMultiArray a) # |
Instance details Defined in PrimitiveExtras.PrimMultiArray Methods (==) :: PrimMultiArray a -> PrimMultiArray a -> Bool # (/=) :: PrimMultiArray a -> PrimMultiArray a -> Bool #

create :: (Monad m, Prim element) => Int -> (forall x. Fold (Int, element) x -> m x) -> m (PrimMultiArray element) #

Given a size of the outer array and a function, which executes a fold over indexed elements in a monad, constructs a prim multi-array

replicateM :: (Monad m, Prim a) => Int -> m (PrimArray a) -> m (PrimMultiArray a) #

outerLength :: PrimMultiArray a -> Int #

Get length of the outer dimension of a primitive multi array

toAssocsUnfoldl :: Prim a => PrimMultiArray a -> Unfoldl (Int, a) #

toIndicesUnfoldl :: PrimMultiArray a -> Unfoldl Int #

toUnfoldlAt :: Prim prim => PrimMultiArray prim -> Int -> Unfoldl prim #

toAssocsUnfoldlM :: forall (m :: Type -> Type) a. (Monad m, Prim a) => PrimMultiArray a -> UnfoldlM m (Int, a) #

toIndicesUnfoldlM :: forall (m :: Type -> Type) a. Monad m => PrimMultiArray a -> UnfoldlM m Int #

toUnfoldlAtM :: forall (m :: Type -> Type) prim. (Monad m, Prim prim) => PrimMultiArray prim -> Int -> UnfoldlM m prim #

cerealGet :: Prim element => Get Int -> Get element -> Get (PrimMultiArray element) #

cerealGetAsInMemory :: Prim element => Get Int -> Get (PrimMultiArray element) #

cerealPut :: Prim element => Putter Int -> Putter element -> Putter (PrimMultiArray element) #

cerealPutAsInMemory :: Prim element => Putter Int -> Putter (PrimMultiArray element) #

fold :: (Integral size, Prim size, Prim element) => PrimArray size -> Fold (Int, element) (PrimMultiArray element) #

Having a priorly computed array of inner dimension sizes, e.g., using the `indexCountsFold`, construct a fold over indexed elements into a multi-array of elements.

Thus it allows to construct it in two passes over the indexed elements.

# Orphan instances

(Show a, Prim a) => Show (PrimMultiArray a) # |
Instance details Methods showsPrec :: Int -> PrimMultiArray a -> ShowS # show :: PrimMultiArray a -> String # showList :: [PrimMultiArray a] -> ShowS #
(Eq a, Prim a) => Eq (PrimMultiArray a) # |
Instance details Methods (==) :: PrimMultiArray a -> PrimMultiArray a -> Bool # (/=) :: PrimMultiArray a -> PrimMultiArray a -> Bool #