on master help sign in
Export important API in Foreign.Mut
6179b73Adithya Kumar
src/Streamly/Internal/Data/Array/Foreign/Mut.hs+31−2
@@ -23,7 +23,9 @@
23-- arrays.
23-- arrays.
24
24
25module Streamly.Internal.Data.Array.Foreign.Mut
25module Streamly.Internal.Data.Array.Foreign.Mut
26+ (
27+ -- * Type
26− ( Array
28+ Array
27 -- , writeIndex
29 -- , writeIndex
28 -- , writeFrom -- start writing at the given position
30 -- , writeFrom -- start writing at the given position
29 -- , writeFromRev
31 -- , writeFromRev
@@ -35,7 +37,10 @@ module Streamly.Internal.Data.Array.Foreign.Mut
35 -- , writeChunksOfFrom
37 -- , writeChunksOfFrom
36 -- , ...
38 -- , ...
37
39
40+ -- * Mutation
38 , writeIndex
41 , writeIndex
42+ , snoc
43+
39 --, writeIndices
44 --, writeIndices
40 --, writeRanges
45 --, writeRanges
41
46
@@ -44,6 +49,29 @@ module Streamly.Internal.Data.Array.Foreign.Mut
44 -- , shuffleBy
49 -- , shuffleBy
45 -- , foldtWith
50 -- , foldtWith
46 -- , foldbWith
51 -- , foldbWith
52+
53+ -- * Folding
54+ , foldl'
55+ , foldr
56+
57+ -- * Composable Folds
58+ , writeN
59+ , write
60+
61+ -- * Unfolds
62+ , read
63+
64+ -- * To containers
65+ , toList
66+
67+ -- * Combining
68+ , spliceWith
69+ , spliceWithDoubling
70+ , spliceTwo
71+
72+ -- * Splitting
73+ , breakOn
74+ , splitAt
47 )
75 )
48where
76where
49
77
@@ -51,7 +79,8 @@ import Control.Monad.IO.Class (MonadIO(..))
51import Foreign.Storable (Storable(..))
79import Foreign.Storable (Storable(..))
52import Streamly.Internal.BaseCompat (unsafeWithForeignPtr)
80import Streamly.Internal.BaseCompat (unsafeWithForeignPtr)
53
81
54−import Prelude hiding (length)
82+import Prelude hiding (foldr, length, read, splitAt)
83+
55import Streamly.Internal.Data.Array.Foreign.Mut.Type
84import Streamly.Internal.Data.Array.Foreign.Mut.Type
56
85
57-- | /O(1)/ Write the given element at the given index in the array.
86-- | /O(1)/ Write the given element at the given index in the array.