Hoogle Search
Within LTS Haskell 24.50 (ghc-9.10.3)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
readSmallArray :: PrimMonad m => SmallMutableArray (PrimState m) a -> Int -> m aprimitive Data.Primitive.SmallArray Read the element at a given index in a mutable array. Note: this function does not do bounds checking.
-
primitive Data.Primitive.SmallArray Resize a mutable array to new specified size. The returned SmallMutableArray is either the original SmallMutableArray resized in-place or, if not possible, a newly allocated SmallMutableArray with the original content copied over. To avoid undefined behaviour, the original SmallMutableArray shall not be accessed anymore after a resizeSmallMutableArray has been performed. Moreover, no reference to the old one should be kept in order to allow garbage collection of the original SmallMutableArray in case a new SmallMutableArray had to be allocated.
runSmallArray :: (forall s . () => ST s (SmallMutableArray s a)) -> SmallArray aprimitive Data.Primitive.SmallArray Execute the monadic action and freeze the resulting array.
runSmallArray m = runST $ m >>= unsafeFreezeSmallArray
shrinkSmallMutableArray :: PrimMonad m => SmallMutableArray (PrimState m) a -> Int -> m ()primitive Data.Primitive.SmallArray Shrink the mutable array in place. The size given must be equal to or less than the current size of the array. This is not checked.
sizeofSmallArray :: SmallArray a -> Intprimitive Data.Primitive.SmallArray The number of elements in an immutable array.
sizeofSmallMutableArray :: SmallMutableArray s a -> Intprimitive Data.Primitive.SmallArray Deprecated: use getSizeofSmallMutableArray instead
smallArrayFromList :: [a] -> SmallArray aprimitive Data.Primitive.SmallArray Create a SmallArray from a list.
smallArrayFromListN :: Int -> [a] -> SmallArray aprimitive Data.Primitive.SmallArray 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.
thawSmallArray :: PrimMonad m => SmallArray a -> Int -> Int -> m (SmallMutableArray (PrimState m) a)primitive Data.Primitive.SmallArray Create a mutable array corresponding to a slice of an immutable array. This operation copies the portion of the array to be thawed. Note: The provided array should contain the full subrange specified by the two Ints, but this is not checked.
traverseSmallArrayP :: PrimMonad m => (a -> m b) -> SmallArray a -> m (SmallArray b)primitive Data.Primitive.SmallArray This is the fastest, most straightforward way to traverse an array, but it only works correctly with a sufficiently "affine" PrimMonad instance. In particular, it must only produce one result array. ListT-transformed monads, for example, will not work right at all.