-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | primitive functions with bounds-checking -- -- This library is intended to be used as a drop-in replacement for the -- primitive library in test environments. It adds bounds-checking -- to all functions in primitive that are able to cause segfaults. -- It is not recommended to use this library in production. However, if -- you are testing a library or application you wrote that uses -- primitive, you can temporarily replace your primitive -- dependency with `primitive-checked`, and your segfaults will become -- normal haskell exceptions that you can hunt down with GHC's stack -- trace facilities. -- -- The versioning for this library matches the version of primitive that -- is targeted. The first three digits of the version match the version -- of primitive. The fourth digit is used for bug fixes. This -- packages deviates slightly from the PVP in that functions can be added -- to the API with only a bump to the fourth digit. @package primitive-checked @version 0.6.4.2 module Data.Primitive.Array -- | Boxed arrays data Array a Array :: Array# a -> Array a [array#] :: Array a -> Array# a -- | Mutable boxed arrays associated with a primitive state token. data MutableArray s a MutableArray :: MutableArray# s a -> MutableArray s a [marray#] :: MutableArray s a -> MutableArray# s a newArray :: (HasCallStack, PrimMonad m) => Int -> a -> m (MutableArray (PrimState m) a) readArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> m a writeArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> a -> m () indexArray :: HasCallStack => Array a -> Int -> a indexArrayM :: HasCallStack => Monad m => Array a -> Int -> m a freezeArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> Int -> m (Array a) thawArray :: (HasCallStack, PrimMonad m) => Array a -> Int -> Int -> m (MutableArray (PrimState m) a) unsafeFreezeArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> m (Array a) -- | Convert an immutable array to an mutable one without copying. The -- immutable array should not be used after the conversion. unsafeThawArray :: PrimMonad m => Array a -> m (MutableArray (PrimState m) a) -- | Check whether the two arrays refer to the same memory block. sameMutableArray :: () => MutableArray s a -> MutableArray s a -> Bool copyArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> Array a -> Int -> Int -> m () copyMutableArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> MutableArray (PrimState m) a -> Int -> Int -> m () cloneArray :: HasCallStack => Array a -> Int -> Int -> Array a cloneMutableArray :: (HasCallStack, PrimMonad m) => MutableArray (PrimState m) a -> Int -> Int -> m (MutableArray (PrimState m) a) sizeofArray :: () => Array a -> Int sizeofMutableArray :: () => MutableArray s a -> Int module Data.Primitive.ByteArray -- | Byte arrays data ByteArray ByteArray :: ByteArray# -> ByteArray -- | Mutable byte arrays associated with a primitive state token data MutableByteArray s MutableByteArray :: MutableByteArray# s -> MutableByteArray s data ByteArray# :: TYPE UnliftedRep data MutableByteArray# (a :: Type) :: Type -> TYPE UnliftedRep newByteArray :: (HasCallStack, PrimMonad m) => Int -> m (MutableByteArray (PrimState m)) newPinnedByteArray :: (HasCallStack, PrimMonad m) => Int -> m (MutableByteArray (PrimState m)) newAlignedPinnedByteArray :: (HasCallStack, PrimMonad m) => Int -> Int -> m (MutableByteArray (PrimState m)) resizeMutableByteArray :: PrimMonad m => MutableByteArray (PrimState m) -> Int -> m (MutableByteArray (PrimState m)) readByteArray :: forall m a. (HasCallStack, Prim a, PrimMonad m) => MutableByteArray (PrimState m) -> Int -> m a writeByteArray :: forall m a. (HasCallStack, Prim a, PrimMonad m) => MutableByteArray (PrimState m) -> Int -> a -> m () indexByteArray :: forall a. (HasCallStack, Prim a) => ByteArray -> Int -> a -- | Right-fold over the elements of a ByteArray. foldrByteArray :: Prim a => (a -> b -> b) -> b -> ByteArray -> b -- | Convert a mutable byte array to an immutable one without copying. The -- array should not be modified after the conversion. unsafeFreezeByteArray :: PrimMonad m => MutableByteArray (PrimState m) -> m ByteArray -- | Convert an immutable byte array to a mutable one without copying. The -- original array should not be used after the conversion. unsafeThawByteArray :: PrimMonad m => ByteArray -> m (MutableByteArray (PrimState m)) copyByteArray :: forall m. (HasCallStack, PrimMonad m) => MutableByteArray (PrimState m) -> Int -> ByteArray -> Int -> Int -> m () copyMutableByteArray :: forall m. (HasCallStack, PrimMonad m) => MutableByteArray (PrimState m) -> Int -> MutableByteArray (PrimState m) -> Int -> Int -> m () moveByteArray :: forall m. (HasCallStack, PrimMonad m) => MutableByteArray (PrimState m) -> Int -> MutableByteArray (PrimState m) -> Int -> Int -> m () setByteArray :: forall m a. (HasCallStack, Prim a, PrimMonad m) => MutableByteArray (PrimState m) -> Int -> Int -> a -> m () fillByteArray :: (HasCallStack, PrimMonad m) => MutableByteArray (PrimState m) -> Int -> Int -> Word8 -> m () -- | Size of the byte array in bytes. sizeofByteArray :: ByteArray -> Int -- | Size of the mutable byte array in bytes. This function's behavior is -- undefined if resizeMutableByteArray is ever called on the -- mutable byte array given as the argument. Consequently, use of this -- function is discouraged. Prefer getSizeofMutableByteArray, -- which ensures correct sequencing in the presence of resizing. sizeofMutableByteArray :: () => MutableByteArray s -> Int -- | Get the size of a byte array in bytes. Unlike -- sizeofMutableByteArray, this function ensures sequencing in the -- presence of resizing. getSizeofMutableByteArray :: PrimMonad m => MutableByteArray (PrimState m) -> m Int -- | Check if the two arrays refer to the same memory block. sameMutableByteArray :: () => MutableByteArray s -> MutableByteArray s -> Bool -- | Yield a pointer to the array's data. This operation is only safe on -- pinned byte arrays allocated by newPinnedByteArray or -- newAlignedPinnedByteArray. byteArrayContents :: ByteArray -> Addr -- | Yield a pointer to the array's data. This operation is only safe on -- pinned byte arrays allocated by newPinnedByteArray or -- newAlignedPinnedByteArray. mutableByteArrayContents :: () => MutableByteArray s -> Addr -- | Check whether or not the byte array is pinned. Pinned byte arrays -- cannot be moved by the garbage collector. It is safe to use -- byteArrayContents on such byte arrays. This function is only -- available when compiling with GHC 8.2 or newer. isByteArrayPinned :: ByteArray -> Bool -- | Check whether or not the mutable byte array is pinned. This function -- is only available when compiling with GHC 8.2 or newer. isMutableByteArrayPinned :: () => MutableByteArray s -> Bool module Data.Primitive.PrimArray -- | Arrays of unboxed elements. This accepts types like Double, -- Char, Int, and Word, as well as their -- fixed-length variants (Word8, Word16, etc.). Since -- the elements are unboxed, a PrimArray is strict in its -- elements. This differs from the behavior of Array, which is -- lazy in its elements. data PrimArray a PrimArray :: ByteArray# -> PrimArray a -- | Mutable primitive arrays associated with a primitive state token. -- These can be written to and read from in a monadic context that -- supports sequencing such as IO or ST. Typically, a -- mutable primitive array will be built and then convert to an immutable -- primitive array using unsafeFreezePrimArray. However, it is -- also acceptable to simply discard a mutable primitive array since it -- lives in managed memory and will be garbage collected when no longer -- referenced. data MutablePrimArray s a MutablePrimArray :: MutableByteArray# s -> MutablePrimArray s a newPrimArray :: forall m a. (HasCallStack, PrimMonad m, Prim a) => Int -> m (MutablePrimArray (PrimState m) a) -- | After a call to resizeMutablePrimArray, the original reference to the -- mutable array should not be used again. This cannot truly be enforced -- except by linear types. To attempt to enforce this, we always make a -- copy of the mutable byte array and intentionally corrupt the original -- of the original one. The strategy used here to corrupt the array is -- simply to write 1 to every bit. resizeMutablePrimArray :: forall m a. (HasCallStack, PrimMonad m, Prim a) => MutablePrimArray (PrimState m) a -> Int -> m (MutablePrimArray (PrimState m) a) shrinkMutablePrimArray :: forall m a. (HasCallStack, PrimMonad m, Prim a) => MutablePrimArray (PrimState m) a -> Int -> m () readPrimArray :: (HasCallStack, Prim a, PrimMonad m) => MutablePrimArray (PrimState m) a -> Int -> m a writePrimArray :: (HasCallStack, Prim a, PrimMonad m) => MutablePrimArray (PrimState m) a -> Int -> a -> m () indexPrimArray :: forall a. Prim a => PrimArray a -> Int -> a -- | This corrupts the contents of the mutable argument array. unsafeFreezePrimArray :: forall m a. (HasCallStack, PrimMonad m, Prim a) => MutablePrimArray (PrimState m) a -> m (PrimArray a) -- | Convert an immutable array to a mutable one without copying. The -- original array should not be used after the conversion. unsafeThawPrimArray :: PrimMonad m => PrimArray a -> m (MutablePrimArray (PrimState m) a) copyPrimArray :: forall m a. (HasCallStack, PrimMonad m, Prim a) => MutablePrimArray (PrimState m) a -> Int -> PrimArray a -> Int -> Int -> m () copyMutablePrimArray :: forall m a. (HasCallStack, PrimMonad m, Prim a) => MutablePrimArray (PrimState m) a -> Int -> MutablePrimArray (PrimState m) a -> Int -> Int -> m () -- | Copy a slice of an immutable primitive array to an address. The offset -- and length are given in elements of type a. This function -- assumes that the Prim instance of a agrees with the -- Storable instance. This function is only available when -- building with GHC 7.8 or newer. copyPrimArrayToPtr :: (PrimMonad m, Prim a) => Ptr a -> PrimArray a -> Int -> Int -> m () -- | Copy a slice of an immutable primitive array to an address. The offset -- and length are given in elements of type a. This function -- assumes that the Prim instance of a agrees with the -- Storable instance. This function is only available when -- building with GHC 7.8 or newer. copyMutablePrimArrayToPtr :: (PrimMonad m, Prim a) => Ptr a -> MutablePrimArray (PrimState m) a -> Int -> Int -> m () setPrimArray :: forall m a. (HasCallStack, Prim a, PrimMonad m) => MutablePrimArray (PrimState m) a -> Int -> Int -> a -> m () -- | Check if the two arrays refer to the same memory block. sameMutablePrimArray :: () => MutablePrimArray s a -> MutablePrimArray s a -> Bool -- | Get the size of a mutable primitive array in elements. Unlike -- sizeofMutablePrimArray, this function ensures sequencing in the -- presence of resizing. getSizeofMutablePrimArray :: (PrimMonad m, Prim a) => MutablePrimArray (PrimState m) a -> m Int -- | Size of the mutable primitive array in elements. This function shall -- not be used on primitive arrays that are an argument to or a result of -- resizeMutablePrimArray or shrinkMutablePrimArray. sizeofMutablePrimArray :: Prim a => MutablePrimArray s a -> Int -- | Get the size, in elements, of the primitive array. sizeofPrimArray :: Prim a => PrimArray a -> Int -- | Lazy right-associated fold over the elements of a PrimArray. foldrPrimArray :: Prim a => (a -> b -> b) -> b -> PrimArray a -> b -- | Strict right-associated fold over the elements of a PrimArray. foldrPrimArray' :: Prim a => (a -> b -> b) -> b -> PrimArray a -> b -- | Lazy left-associated fold over the elements of a PrimArray. foldlPrimArray :: Prim a => (b -> a -> b) -> b -> PrimArray a -> b -- | Strict left-associated fold over the elements of a PrimArray. foldlPrimArray' :: Prim a => (b -> a -> b) -> b -> PrimArray a -> b -- | Strict left-associated fold over the elements of a PrimArray. foldlPrimArrayM' :: (Prim a, Monad m) => (b -> a -> m b) -> b -> PrimArray a -> m b -- | Traverse the primitive array, discarding the results. There is no -- PrimMonad variant of this function since it would not provide -- any performance benefit. traversePrimArray_ :: (Applicative f, Prim a) => (a -> f b) -> PrimArray a -> f () -- | Traverse the primitive array with the indices, discarding the results. -- There is no PrimMonad variant of this function since it would -- not provide any performance benefit. itraversePrimArray_ :: (Applicative f, Prim a) => (Int -> a -> f b) -> PrimArray a -> f () -- | Map over the elements of a primitive array. mapPrimArray :: (Prim a, Prim b) => (a -> b) -> PrimArray a -> PrimArray b -- | Indexed map over the elements of a primitive array. imapPrimArray :: (Prim a, Prim b) => (Int -> a -> b) -> PrimArray a -> PrimArray b -- | Generate a primitive array. generatePrimArray :: Prim a => Int -> (Int -> a) -> PrimArray a -- | Create a primitive array by copying the element the given number of -- times. replicatePrimArray :: Prim a => Int -> a -> PrimArray a -- | Filter elements of a primitive array according to a predicate. filterPrimArray :: Prim a => (a -> Bool) -> PrimArray a -> PrimArray a -- | Map over a primitive array, optionally discarding some elements. This -- has the same behavior as Data.Maybe.mapMaybe. mapMaybePrimArray :: (Prim a, Prim b) => (a -> Maybe b) -> PrimArray a -> PrimArray b -- | Traverse a primitive array. The traversal performs all of the -- applicative effects before forcing the resulting values and -- writing them to the new primitive array. Consequently: -- --
--   >>> traversePrimArray (\x -> print x $> bool x undefined (x == 2)) (fromList [1, 2, 3 :: Int])
--   1
--   2
--   3
--   *** Exception: Prelude.undefined
--   
-- -- The function traversePrimArrayP always outperforms this -- function, but it requires a PrimAffineMonad constraint, and -- it forces the values as it performs the effects. traversePrimArray :: (Applicative f, Prim a, Prim b) => (a -> f b) -> PrimArray a -> f (PrimArray b) -- | Traverse a primitive array with the index of each element. itraversePrimArray :: (Applicative f, Prim a, Prim b) => (Int -> a -> f b) -> PrimArray a -> f (PrimArray b) -- | Generate a primitive array by evaluating the applicative generator -- function at each index. generatePrimArrayA :: (Applicative f, Prim a) => Int -> (Int -> f a) -> f (PrimArray a) -- | Execute the applicative action the given number of times and store the -- results in a vector. replicatePrimArrayA :: (Applicative f, Prim a) => Int -> f a -> f (PrimArray a) -- | Filter the primitive array, keeping the elements for which the monadic -- predicate evaluates true. filterPrimArrayA :: (Applicative f, Prim a) => (a -> f Bool) -> PrimArray a -> f (PrimArray a) -- | Map over the primitive array, keeping the elements for which the -- applicative predicate provides a Just. mapMaybePrimArrayA :: (Applicative f, Prim a, Prim b) => (a -> f (Maybe b)) -> PrimArray a -> f (PrimArray b) -- | Traverse a primitive array. The traversal forces the resulting values -- and writes them to the new primitive array as it performs the monadic -- effects. Consequently: -- --
--   >>> traversePrimArrayP (\x -> print x $> bool x undefined (x == 2)) (fromList [1, 2, 3 :: Int])
--   1
--   2
--   *** Exception: Prelude.undefined
--   
-- -- In many situations, traversePrimArrayP can replace -- traversePrimArray, changing the strictness characteristics of -- the traversal but typically improving the performance. Consider the -- following short-circuiting traversal: -- --
--   incrPositiveA :: PrimArray Int -> Maybe (PrimArray Int)
--   incrPositiveA xs = traversePrimArray (\x -> bool Nothing (Just (x + 1)) (x > 0)) xs
--   
-- -- This can be rewritten using traversePrimArrayP. To do this, we -- must change the traversal context to MaybeT (ST s), which has -- a PrimMonad instance: -- --
--   incrPositiveB :: PrimArray Int -> Maybe (PrimArray Int)
--   incrPositiveB xs = runST $ runMaybeT $ traversePrimArrayP
--     (\x -> bool (MaybeT (return Nothing)) (MaybeT (return (Just (x + 1)))) (x > 0))
--     xs
--   
-- -- Benchmarks demonstrate that the second implementation runs 150 times -- faster than the first. It also results in fewer allocations. traversePrimArrayP :: (PrimMonad m, Prim a, Prim b) => (a -> m b) -> PrimArray a -> m (PrimArray b) -- | Traverse a primitive array with the indices. The traversal forces the -- resulting values and writes them to the new primitive array as it -- performs the monadic effects. itraversePrimArrayP :: (Prim a, Prim b, PrimMonad m) => (Int -> a -> m b) -> PrimArray a -> m (PrimArray b) -- | Generate a primitive array by evaluating the monadic generator -- function at each index. generatePrimArrayP :: (PrimMonad m, Prim a) => Int -> (Int -> m a) -> m (PrimArray a) -- | Execute the monadic action the given number of times and store the -- results in a primitive array. replicatePrimArrayP :: (PrimMonad m, Prim a) => Int -> m a -> m (PrimArray a) -- | Filter the primitive array, keeping the elements for which the monadic -- predicate evaluates true. filterPrimArrayP :: (PrimMonad m, Prim a) => (a -> m Bool) -> PrimArray a -> m (PrimArray a) -- | Map over the primitive array, keeping the elements for which the -- monadic predicate provides a Just. mapMaybePrimArrayP :: (PrimMonad m, Prim a, Prim b) => (a -> m (Maybe b)) -> PrimArray a -> m (PrimArray b) module Data.Primitive.SmallArray data SmallArray a SmallArray :: SmallArray# a -> SmallArray a data SmallMutableArray s a SmallMutableArray :: SmallMutableArray# s a -> SmallMutableArray s a newSmallArray :: (HasCallStack, PrimMonad m) => Int -> a -> m (SmallMutableArray (PrimState m) a) readSmallArray :: (HasCallStack, PrimMonad m) => SmallMutableArray (PrimState m) a -> Int -> m a writeSmallArray :: (HasCallStack, PrimMonad m) => SmallMutableArray (PrimState m) a -> Int -> a -> m () indexSmallArray :: HasCallStack => SmallArray a -> Int -> a indexSmallArray## :: HasCallStack => SmallArray a -> Int -> (# a #) indexSmallArrayM :: (HasCallStack, Monad m) => SmallArray a -> Int -> m a freezeSmallArray :: (HasCallStack, PrimMonad m) => SmallMutableArray (PrimState m) a -> Int -> Int -> m (SmallArray a) thawSmallArray :: (HasCallStack, PrimMonad m) => SmallArray a -> Int -> Int -> m (SmallMutableArray (PrimState m) a) unsafeFreezeSmallArray :: (HasCallStack, PrimMonad m) => SmallMutableArray (PrimState m) a -> m (SmallArray a) -- | Render an immutable array mutable. -- -- This operation performs no copying, so care must be taken with its -- use. unsafeThawSmallArray :: PrimMonad m => SmallArray a -> m (SmallMutableArray (PrimState m) a) copySmallArray :: (HasCallStack, PrimMonad m) => SmallMutableArray (PrimState m) a -> Int -> SmallArray a -> Int -> Int -> m () copySmallMutableArray :: (HasCallStack, PrimMonad m) => SmallMutableArray (PrimState m) a -> Int -> SmallMutableArray (PrimState m) a -> Int -> Int -> m () cloneSmallArray :: HasCallStack => SmallArray a -> Int -> Int -> SmallArray a cloneSmallMutableArray :: (HasCallStack, PrimMonad m) => SmallMutableArray (PrimState m) a -> Int -> Int -> m (SmallMutableArray (PrimState m) a) sizeofSmallArray :: () => SmallArray a -> Int sizeofSmallMutableArray :: () => SmallMutableArray s a -> Int -- | Create a SmallArray from a list. smallArrayFromList :: () => [a] -> SmallArray a -- | Create a SmallArray from a list of a known length. If the -- length of the list does not match the given length, this throws an -- exception. smallArrayFromListN :: () => Int -> [a] -> SmallArray a module Data.Primitive.UnliftedArray -- | Immutable arrays that efficiently store types that are simple wrappers -- around unlifted primitive types. The values of the unlifted type are -- stored directly, eliminating a layer of indirection. data UnliftedArray e UnliftedArray :: ArrayArray# -> UnliftedArray e -- | Mutable arrays that efficiently store types that are simple wrappers -- around unlifted primitive types. The values of the unlifted type are -- stored directly, eliminating a layer of indirection. data MutableUnliftedArray s e MutableUnliftedArray :: MutableArrayArray# s -> MutableUnliftedArray s e -- | Classifies the types that are able to be stored in -- UnliftedArray and MutableUnliftedArray. These should be -- types that are just liftings of the unlifted pointer types, so that -- their internal contents can be safely coerced into an -- ArrayArray#. class PrimUnlifted a toArrayArray# :: PrimUnlifted a => a -> ArrayArray# fromArrayArray# :: PrimUnlifted a => ArrayArray# -> a unsafeNewUnliftedArray :: (HasCallStack, PrimMonad m) => Int -> m (MutableUnliftedArray (PrimState m) a) newUnliftedArray :: (HasCallStack, PrimMonad m, PrimUnlifted a) => Int -> a -> m (MutableUnliftedArray (PrimState m) a) -- | Sets all the positions in an unlifted array to the designated value. setUnliftedArray :: (PrimMonad m, PrimUnlifted a) => MutableUnliftedArray (PrimState m) a -> a -> m () -- | Yields the length of an UnliftedArray. sizeofUnliftedArray :: () => UnliftedArray e -> Int -- | Yields the length of a MutableUnliftedArray. sizeofMutableUnliftedArray :: () => MutableUnliftedArray s e -> Int readUnliftedArray :: (HasCallStack, PrimMonad m, PrimUnlifted a) => MutableUnliftedArray (PrimState m) a -> Int -> m a writeUnliftedArray :: (HasCallStack, PrimMonad m, PrimUnlifted a) => MutableUnliftedArray (PrimState m) a -> Int -> a -> m () indexUnliftedArray :: (HasCallStack, PrimUnlifted a) => UnliftedArray a -> Int -> a indexUnliftedArrayM :: (HasCallStack, Monad m, PrimUnlifted a) => UnliftedArray a -> Int -> m a -- | Freezes a MutableUnliftedArray, yielding an -- UnliftedArray. This simply marks the array as frozen in place, -- so it should only be used when no further modifications to the mutable -- array will be performed. unsafeFreezeUnliftedArray :: PrimMonad m => MutableUnliftedArray (PrimState m) a -> m (UnliftedArray a) freezeUnliftedArray :: (HasCallStack, PrimMonad m) => MutableUnliftedArray (PrimState m) a -> Int -> Int -> m (UnliftedArray a) thawUnliftedArray :: (HasCallStack, PrimMonad m) => UnliftedArray a -> Int -> Int -> m (MutableUnliftedArray (PrimState m) a) -- | Determines whether two MutableUnliftedArray values are the -- same. This is object/pointer identity, not based on the contents. sameMutableUnliftedArray :: () => MutableUnliftedArray s a -> MutableUnliftedArray s a -> Bool copyUnliftedArray :: (HasCallStack, PrimMonad m) => MutableUnliftedArray (PrimState m) a -> Int -> UnliftedArray a -> Int -> Int -> m () copyMutableUnliftedArray :: (HasCallStack, PrimMonad m) => MutableUnliftedArray (PrimState m) a -> Int -> MutableUnliftedArray (PrimState m) a -> Int -> Int -> m () cloneUnliftedArray :: HasCallStack => UnliftedArray a -> Int -> Int -> UnliftedArray a cloneMutableUnliftedArray :: (HasCallStack, PrimMonad m) => MutableUnliftedArray (PrimState m) a -> Int -> Int -> m (MutableUnliftedArray (PrimState m) a) -- | Map over the elements of an UnliftedArray. mapUnliftedArray :: (PrimUnlifted a, PrimUnlifted b) => (a -> b) -> UnliftedArray a -> UnliftedArray b -- | Lazy right-associated fold over the elements of an -- UnliftedArray. foldrUnliftedArray :: PrimUnlifted a => (a -> b -> b) -> b -> UnliftedArray a -> b -- | Lazy left-associated fold over the elements of an -- UnliftedArray. foldlUnliftedArray :: PrimUnlifted a => (b -> a -> b) -> b -> UnliftedArray a -> b -- | Strict right-associated fold over the elements of an 'UnliftedArray. foldrUnliftedArray' :: PrimUnlifted a => (a -> b -> b) -> b -> UnliftedArray a -> b -- | Strict left-associated fold over the elements of an -- UnliftedArray. foldlUnliftedArray' :: PrimUnlifted a => (b -> a -> b) -> b -> UnliftedArray a -> b unliftedArrayFromList :: PrimUnlifted a => [a] -> UnliftedArray a module Data.Primitive