@@ -36,8 +36,6 @@ module Streamly.Internal.Data.Array.Foreign
3636 (
3737 Array
3838
39− -- , defaultChunkSize
40−
4139 -- * Construction
4240
4341 -- Pure, From Static Memory (Unsafe)
@@ -55,64 +53,63 @@ module Streamly.Internal.Data.Array.Foreign
5553 , fromStreamN
5654 , fromStream
5755
58− -- Monadic APIs
59− -- , newArray
56+ -- Monadic Folds
6057 , A.writeN -- drop new
6158 , A.writeNAligned
6259 , A.write -- full buffer
6360 , writeLastN
6461
6562 -- * Elimination
66−
6763 , A.toList
6864 , A.toStream
6965 , A.toStreamRev
7066 , read
71− , producer
72− , unsafeRead
67+ , unsafeRead -- XXX readUnsafe?
7368 , A.readRev
74− -- , readChunksOf
69+ , producer -- experimental
7570
7671 -- * Random Access
77− , length
78− , null
79− , last
8072 -- , (!!)
8173 , getIndex
82− , A.unsafeIndex
83− -- , readIndices
84− -- , readRanges
85−
86− -- , readFrom -- read from a given position to the end of file
87− -- , readFromRev -- read from a given position to the beginning of file
88− -- , readTo -- read from beginning up to the given position
89− -- , readToRev -- read from end to the given position in file
90− -- , readFromTo
91− -- , readFromThenTo
92−
93− -- , readChunksOfFrom
94− -- , ...
95−
96− -- -- * Search
97− -- , bsearch
98− -- , bsearchIndex
99− -- , find
100− -- , findIndex
101− -- , findIndices
102−
103− , unsafeSlice
74+ , A.unsafeIndex -- XXX Rename to getIndexUnsafe??
75+ -- , getIndexRev
76+ , last -- XXX getIndexLast?
77+ -- , getIndices
78+ -- , getIndicesFromThenTo
79+ -- , getIndicesFrom -- read from a given position to the end of file
80+ -- , getIndicesUpto -- read from beginning up to the given position
81+ -- , getIndicesFromTo
82+ -- , getIndicesFromRev -- read from a given position to the beginning of file
83+ -- , getIndicesUptoRev -- read from end to the given position in file
84+
85+ -- * Size
86+ , length
87+ , null
10488
105− -- * Immutable Transformations
106− , streamTransform
89+ -- * Search
90+ -- , binarySearch
91+ -- , findIndicesOf
92+ -- , findIndexOf
93+ -- , find
10794
10895 -- * Casting
10996 , cast
110− , unsafeCast
111− , unsafeAsPtr
11297 , asBytes
113− , unsafeAsCString
98+ , unsafeCast -- castUnsafe?
99+ , unsafeAsPtr -- asPtrUnsafe?
100+ , unsafeAsCString -- asCStringUnsafe?
101+ , A.unsafeFreeze -- asImmutableUnsafe?
102+ , A.unsafeThaw -- asMutableUnsafe?
114103
115− -- * Folding Arrays
104+ -- * Subarrays
105+ , unsafeSlice
106+ -- , getSlice
107+ -- , getSlicesFromLenN
108+
109+ -- * Streaming Operations
110+ , streamTransform
111+
112+ -- ** Folding
116113 , streamFold
117114 , fold
118115 )
@@ -331,7 +328,7 @@ findIndices = undefined
331328-- XXX We can potentially use SIMD instructions on arrays to fold faster.
332329
333330-------------------------------------------------------------------------------
334−-- Slice and splice
331+-- Slice
335332-------------------------------------------------------------------------------
336333
337334-- | /O(1)/ Slice an array in constant time.
@@ -354,18 +351,6 @@ unsafeSlice start len (Array fp _) =
354351 end = unsafeForeignPtrToPtr fp1 `plusPtr` (len * size)
355352 in Array fp1 end
356353
357−{-
358−
359−splitAt :: Int -> Array a -> (Array a, Array a)
360−splitAt i arr = undefined
361−
362−-- XXX This operation can be performed efficiently via streams.
363−-- | Append two arrays together to create a single array.
364−splice :: Array a -> Array a -> Array a
365−splice arr1 arr2 = undefined
366−
367−-}
368−
369354-------------------------------------------------------------------------------
370355-- Random reads and writes
371356-------------------------------------------------------------------------------