on master help sign in
export writeNAligned and unsafeIndex
be43922Harendra Kumar
src/Streamly/Internal/Memory/Array.hs+2
@@ -57,6 +57,7 @@ module Streamly.Internal.Memory.Array
57 -- Monadic APIs
57 -- Monadic APIs
58 -- , newArray
58 -- , newArray
59 , A.writeN -- drop new
59 , A.writeN -- drop new
60+ , A.writeNAligned
60 , A.write -- full buffer
61 , A.write -- full buffer
61 -- , writeLastN -- drop old (ring buffer)
62 -- , writeLastN -- drop old (ring buffer)
62
63
@@ -74,6 +75,7 @@ module Streamly.Internal.Memory.Array
74 , last
75 , last
75 -- , (!!)
76 -- , (!!)
76 , readIndex
77 , readIndex
78+ , A.unsafeIndex
77 -- , readIndices
79 -- , readIndices
78 -- , readRanges
80 -- , readRanges
79
81
src/Streamly/Internal/Memory/Array/Types.hs+1−1
@@ -539,7 +539,7 @@ writeNAllocWith alloc n = Fold step initial extract
539writeN :: forall m a. (MonadIO m, Storable a) => Int -> Fold m a (Array a)
539writeN :: forall m a. (MonadIO m, Storable a) => Int -> Fold m a (Array a)
540writeN = writeNAllocWith newArray
540writeN = writeNAllocWith newArray
541
541
542−-- | @writeNAligned n@ folds a maximum of @n@ elements from the input
542+-- | @writeNAligned alignment n@ folds a maximum of @n@ elements from the input
543-- stream to an 'Array' aligned to the given size.
543-- stream to an 'Array' aligned to the given size.
544--
544--
545-- /Internal/
545-- /Internal/