-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Extras for the "primitive" library -- -- Extras for the "primitive" library @package primitive-extras @version 0.1 module PrimitiveExtras.Data data PrimMultiArray a module PrimitiveExtras.IO generateUnliftedArray :: PrimUnlifted a => Int -> (Int -> IO a) -> IO (UnliftedArray a) replicateUnliftedArray :: PrimUnlifted a => Int -> IO a -> IO (UnliftedArray a) module PrimitiveExtras.Fold -- | Given a size of the array, construct a fold, which produces an array -- of index counts. indexCounts :: (Integral count, Prim count) => Int -> Fold Int (PrimArray count) -- | This function is partial in the sense that it expects the index vector -- of produced elements to be within the specified amount. unliftedArray :: PrimUnlifted element => Int -> Fold (Int, element) (UnliftedArray element) -- | Having a priorly computed array of inner dimension sizes, e.g., using -- the indexCounts fold, 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. primMultiArray :: forall size element. (Integral size, Prim size, Prim element) => PrimArray size -> Fold (Int, element) (PrimMultiArray element) module PrimitiveExtras.Unfold primMultiArrayIndices :: PrimMultiArray a -> Unfold Int primMultiArrayAt :: Prim prim => PrimMultiArray prim -> Int -> Unfold prim primArray :: Prim prim => PrimArray prim -> Unfold prim module PrimitiveExtras.Monad -- | 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 primMultiArray :: (Monad m, Prim element) => Int -> (forall x. Fold (Int, element) x -> m x) -> m (PrimMultiArray element)