on master help sign in
Rename Data.Array.Storable.Foreign to Data.Array.Foreign.
5c018c7Pranay Sashank
.hlint.ignore+1−1
@@ -30,7 +30,7 @@ test/Streamly/Test/Common/Array.hs
30test/Streamly/Test/Data/Array.hs
30test/Streamly/Test/Data/Array.hs
31test/Streamly/Test/Data/Array/Prim.hs
31test/Streamly/Test/Data/Array/Prim.hs
32test/Streamly/Test/Data/Array/Prim/Pinned.hs
32test/Streamly/Test/Data/Array/Prim/Pinned.hs
33−test/Streamly/Test/Data/Array/Storable/Foreign.hs
33+test/Streamly/Test/Data/Array/Foreign.hs
34test/Streamly/Test/Data/Parser.hs
34test/Streamly/Test/Data/Parser.hs
35test/Streamly/Test/Data/Parser/ParserD.hs
35test/Streamly/Test/Data/Parser/ParserD.hs
36test/Streamly/Test/Data/SmallArray.hs
36test/Streamly/Test/Data/SmallArray.hs
Changelog.md+1−1
@@ -52,7 +52,7 @@
52### Deprecations
52### Deprecations
53
53
54* Deprecate `Streamly.Memory.Array` in favor of
54* Deprecate `Streamly.Memory.Array` in favor of
55− `Streamly.Data.Array.Storable.Foreign`
55+ `Streamly.Data.Array.Foreign`
56* Deprecate `Streamly.Data.Unicode.Stream` in favor of
56* Deprecate `Streamly.Data.Unicode.Stream` in favor of
57 `Streamly.Unicode.Stream`
57 `Streamly.Unicode.Stream`
58* The `Streamly` module is now deprecated, its functionality is subsumed
58* The `Streamly` module is now deprecated, its functionality is subsumed
README.md+3−3
@@ -362,7 +362,7 @@ documentation.
362
362
363## Arrays
363## Arrays
364
364
365−The `Streamly.Data.Array.Storable.Foreign` module provides immutable arrays. Arrays are the
365+The `Streamly.Data.Array.Foreign` module provides immutable arrays. Arrays are the
366computing duals of streams. Streams are good at sequential access and immutable
366computing duals of streams. Streams are good at sequential access and immutable
367transformations of in-transit data whereas arrays are good at random access and
367transformations of in-transit data whereas arrays are good at random access and
368in-place transformations of buffered data. Unlike streams which are potentially
368in-place transformations of buffered data. Unlike streams which are potentially
@@ -373,7 +373,7 @@ computing system. The design of streamly as a general purpose computing
373framework is centered around these two fundamental aspects of computing and
373framework is centered around these two fundamental aspects of computing and
374storage.
374storage.
375
375
376−`Streamly.Data.Array.Storable.Foreign` uses pinned memory outside GC and therefore avoid any
376+`Streamly.Data.Array.Foreign` uses pinned memory outside GC and therefore avoid any
377GC overhead for the storage in arrays. Streamly allows efficient
377GC overhead for the storage in arrays. Streamly allows efficient
378transformations over arrays using streams. It uses arrays to transfer data to
378transformations over arrays using streams. It uses arrays to transfer data to
379and from the operating system and to store data in memory.
379and from the operating system and to store data in memory.
@@ -416,7 +416,7 @@ module Main where
416
416
417import qualified Streamly.Prelude as S
417import qualified Streamly.Prelude as S
418import qualified Streamly.Data.Fold as FL
418import qualified Streamly.Data.Fold as FL
419−import qualified Streamly.Data.Array.Storable.Foreign as A
419+import qualified Streamly.Data.Array.Foreign as A
420import qualified Streamly.FileSystem.Handle as FH
420import qualified Streamly.FileSystem.Handle as FH
421import qualified System.IO as FH
421import qualified System.IO as FH
422
422
benchmark/NanoBenchmarks.hs+1−1
@@ -9,7 +9,7 @@
9import Streamly.Prelude (SerialT)
9import Streamly.Prelude (SerialT)
10import Streamly.Internal.Data.SVar (MonadAsync)
10import Streamly.Internal.Data.SVar (MonadAsync)
11
11
12−import qualified Streamly.Data.Array.Storable.Foreign as A
12+import qualified Streamly.Data.Array.Foreign as A
13import qualified Streamly.FileSystem.Handle as FH
13import qualified Streamly.FileSystem.Handle as FH
14import qualified Streamly.Internal.FileSystem.Handle as IFH
14import qualified Streamly.Internal.FileSystem.Handle as IFH
15import qualified Streamly.Data.Fold as FL
15import qualified Streamly.Data.Fold as FL
benchmark/Streamly/Benchmark/Data/Array.hs+2−2
@@ -12,8 +12,8 @@ import Control.DeepSeq (NFData(..))
12import System.Random (randomRIO)
12import System.Random (randomRIO)
13
13
14import qualified Streamly.Benchmark.Data.ArrayOps as Ops
14import qualified Streamly.Benchmark.Data.ArrayOps as Ops
15−import qualified Streamly.Data.Array.Storable.Foreign as A
15+import qualified Streamly.Data.Array.Foreign as A
16−import qualified Streamly.Internal.Data.Array.Storable.Foreign as IA
16+import qualified Streamly.Internal.Data.Array.Foreign as IA
17import qualified Streamly.Prelude as S
17import qualified Streamly.Prelude as S
18
18
19import Gauge
19import Gauge
benchmark/Streamly/Benchmark/Data/ArrayOps.hs+2−2
@@ -35,8 +35,8 @@ import qualified Streamly.Internal.Data.SmallArray as A
35type Stream = A.SmallArray
35type Stream = A.SmallArray
36#elif defined(MEMORY_ARRAY)
36#elif defined(MEMORY_ARRAY)
37import qualified GHC.Exts as GHC
37import qualified GHC.Exts as GHC
38−import qualified Streamly.Data.Array.Storable.Foreign as A
38+import qualified Streamly.Data.Array.Foreign as A
39−import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
39+import qualified Streamly.Internal.Data.Array.Foreign as A
40type Stream = A.Array
40type Stream = A.Array
41#elif defined(DATA_ARRAY_PRIM)
41#elif defined(DATA_ARRAY_PRIM)
42import qualified Streamly.Internal.Data.Array.Prim as A
42import qualified Streamly.Internal.Data.Array.Prim as A
benchmark/Streamly/Benchmark/FileSystem/Handle/Read.hs+3−3
@@ -33,8 +33,8 @@ import GHC.Magic (noinline)
33import System.IO (Handle)
33import System.IO (Handle)
34
34
35import qualified Streamly.FileSystem.Handle as FH
35import qualified Streamly.FileSystem.Handle as FH
36−import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
36+import qualified Streamly.Internal.Data.Array.Foreign as A
37−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as AT
37+import qualified Streamly.Internal.Data.Array.Foreign.Types as AT
38import qualified Streamly.Internal.Data.Fold as FL
38import qualified Streamly.Internal.Data.Fold as FL
39import qualified Streamly.Internal.Data.Parser as PR
39import qualified Streamly.Internal.Data.Parser as PR
40import qualified Streamly.Internal.Data.Stream.IsStream as IP
40import qualified Streamly.Internal.Data.Stream.IsStream as IP
@@ -51,7 +51,7 @@ import Streamly.Benchmark.Common.Handle
51#ifdef INSPECTION
51#ifdef INSPECTION
52import Streamly.Internal.Data.Stream.StreamD.Type (Step(..), GroupState)
52import Streamly.Internal.Data.Stream.StreamD.Type (Step(..), GroupState)
53
53
54−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types as MA
54+import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
55import qualified Streamly.Internal.Data.Stream.StreamD as D
55import qualified Streamly.Internal.Data.Stream.StreamD as D
56import qualified Streamly.Internal.Data.Unfold as IUF
56import qualified Streamly.Internal.Data.Unfold as IUF
57
57
benchmark/Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs+4−4
@@ -24,13 +24,13 @@ where
24
24
25import System.IO (Handle)
25import System.IO (Handle)
26import Prelude hiding (last, length)
26import Prelude hiding (last, length)
27−import Streamly.Internal.Data.Array.Storable.Foreign.Types (defaultChunkSize)
27+import Streamly.Internal.Data.Array.Foreign.Types (defaultChunkSize)
28
28
29import qualified Streamly.FileSystem.Handle as FH
29import qualified Streamly.FileSystem.Handle as FH
30import qualified Streamly.Internal.Data.Unfold as IUF
30import qualified Streamly.Internal.Data.Unfold as IUF
31import qualified Streamly.Internal.FileSystem.Handle as IFH
31import qualified Streamly.Internal.FileSystem.Handle as IFH
32import qualified Streamly.Internal.Memory.ArrayStream as AS
32import qualified Streamly.Internal.Memory.ArrayStream as AS
33−import qualified Streamly.Data.Array.Storable.Foreign as A
33+import qualified Streamly.Data.Array.Foreign as A
34import qualified Streamly.Prelude as S
34import qualified Streamly.Prelude as S
35
35
36import Gauge hiding (env)
36import Gauge hiding (env)
@@ -43,8 +43,8 @@ import Streamly.Internal.Data.Stream.StreamD.Type (Step(..))
43import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
43import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
44import qualified Streamly.Internal.Data.Tuple.Strict as Strict
44import qualified Streamly.Internal.Data.Tuple.Strict as Strict
45import qualified Streamly.Internal.Data.Array.Stream.Mut.Foreign as MAS
45import qualified Streamly.Internal.Data.Array.Stream.Mut.Foreign as MAS
46−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as AT
46+import qualified Streamly.Internal.Data.Array.Foreign.Types as AT
47−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types as MA
47+import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
48
48
49import Test.Inspection
49import Test.Inspection
50#endif
50#endif
benchmark/Streamly/Benchmark/Prelude/Serial/Split.hs+2−3
@@ -25,7 +25,7 @@ import Data.Word (Word8)
25import System.IO (Handle)
25import System.IO (Handle)
26
26
27import qualified Streamly.FileSystem.Handle as FH
27import qualified Streamly.FileSystem.Handle as FH
28−import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
28+import qualified Streamly.Internal.Data.Array.Foreign as A
29import qualified Streamly.Internal.Data.Fold as FL
29import qualified Streamly.Internal.Data.Fold as FL
30import qualified Streamly.Internal.Data.Parser as PR
30import qualified Streamly.Internal.Data.Parser as PR
31import qualified Streamly.Internal.Data.Stream.IsStream as IP
31import qualified Streamly.Internal.Data.Stream.IsStream as IP
@@ -41,7 +41,7 @@ import Streamly.Benchmark.Common.Handle
41#ifdef INSPECTION
41#ifdef INSPECTION
42import Streamly.Internal.Data.Stream.StreamD.Type (Step(..))
42import Streamly.Internal.Data.Stream.StreamD.Type (Step(..))
43
43
44−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types as MA
44+import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
45import qualified Streamly.Internal.Data.Unfold as IUF
45import qualified Streamly.Internal.Data.Unfold as IUF
46
46
47import Test.Inspection
47import Test.Inspection
@@ -229,4 +229,3 @@ benchmarks moduleName env =
229 , o_1_space_reduce_toChunks_split env
229 , o_1_space_reduce_toChunks_split env
230 ]
230 ]
231 ]
231 ]
232−
benchmark/Streamly/Benchmark/Unicode/Stream.hs+3−3
@@ -29,7 +29,7 @@ import qualified Streamly.Internal.Unicode.Stream as IUS
29import qualified Streamly.Internal.FileSystem.Handle as IFH
29import qualified Streamly.Internal.FileSystem.Handle as IFH
30import qualified Streamly.Internal.Unicode.Array.Char as IUA
30import qualified Streamly.Internal.Unicode.Array.Char as IUA
31import qualified Streamly.Internal.Data.Stream.IsStream as IP
31import qualified Streamly.Internal.Data.Stream.IsStream as IP
32−import qualified Streamly.Data.Array.Storable.Foreign as A
32+import qualified Streamly.Data.Array.Foreign as A
33import qualified Streamly.Prelude as S
33import qualified Streamly.Prelude as S
34
34
35import Gauge hiding (env)
35import Gauge hiding (env)
@@ -40,8 +40,8 @@ import Streamly.Benchmark.Common.Handle
40import Foreign.Storable (Storable)
40import Foreign.Storable (Storable)
41import Streamly.Internal.Data.Stream.StreamD.Type (Step(..))
41import Streamly.Internal.Data.Stream.StreamD.Type (Step(..))
42import qualified Streamly.Internal.Data.Tuple.Strict as Strict
42import qualified Streamly.Internal.Data.Tuple.Strict as Strict
43−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as AT
43+import qualified Streamly.Internal.Data.Array.Foreign.Types as AT
44−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types as MA
44+import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
45
45
46import Test.Inspection
46import Test.Inspection
47#endif
47#endif
benchmark/streamly-benchmarks.cabal+3−3
@@ -162,7 +162,7 @@ common bench-options-threaded
162benchmark Prelude.Serial
162benchmark Prelude.Serial
163 import: bench-options
163 import: bench-options
164 type: exitcode-stdio-1.0
164 type: exitcode-stdio-1.0
165− hs-source-dirs: Streamly/Benchmark/Prelude
165+ hs-source-dirs: Streamly/Benchmark/Prelude
166 main-is: Serial.hs
166 main-is: Serial.hs
167 other-modules:
167 other-modules:
168 Serial.Generation
168 Serial.Generation
@@ -432,7 +432,7 @@ benchmark Data.Array.Prim.Pinned
432 other-modules: Streamly.Benchmark.Data.ArrayOps
432 other-modules: Streamly.Benchmark.Data.ArrayOps
433 cpp-options: -DDATA_ARRAY_PRIM_PINNED
433 cpp-options: -DDATA_ARRAY_PRIM_PINNED
434
434
435−benchmark Data.Array.Storable.Foreign
435+benchmark Data.Array.Foreign
436 import: bench-options
436 import: bench-options
437 type: exitcode-stdio-1.0
437 type: exitcode-stdio-1.0
438 hs-source-dirs: .
438 hs-source-dirs: .
@@ -461,7 +461,7 @@ benchmark Unicode.Stream
461 type: exitcode-stdio-1.0
461 type: exitcode-stdio-1.0
462 hs-source-dirs: Streamly/Benchmark/Unicode
462 hs-source-dirs: Streamly/Benchmark/Unicode
463 main-is: Stream.hs
463 main-is: Stream.hs
464−
464+
465-------------------------------------------------------------------------------
465-------------------------------------------------------------------------------
466-- benchmark comparison and presentation
466-- benchmark comparison and presentation
467-------------------------------------------------------------------------------
467-------------------------------------------------------------------------------
bin/targets.sh+1−1
@@ -34,7 +34,7 @@ prelude_other_grp="\
34
34
35array_grp="\
35array_grp="\
36 Data.Array \
36 Data.Array \
37− Data.Array.Storable.Foreign \
37+ Data.Array.Foreign \
38 Data.Array.Prim \
38 Data.Array.Prim \
39 Data.SmallArray \
39 Data.SmallArray \
40 Data.Array.Prim.Pinned"
40 Data.Array.Prim.Pinned"
design/module-organization.md+3−3
@@ -143,9 +143,9 @@ conflict with any other module on Hackage.
143We have the following module hierarchy under Streamly:
143We have the following module hierarchy under Streamly:
144
144
145* Data: This is a generic bucket for basic data structures a la the `base`
145* Data: This is a generic bucket for basic data structures a la the `base`
146− package's `Data` hierarchy.
146+ package's `Data` hierarchy.
147 * Streamly.Data.Array
147 * Streamly.Data.Array
148−
148+
149 Streams can be classified under `Data` or `Control`. Though they are
149 Streams can be classified under `Data` or `Control`. Though they are
150 mostly used for processing, they can also be used to store data in
150 mostly used for processing, they can also be used to store data in
151 memory.
151 memory.
@@ -216,7 +216,7 @@ Similarly, the immutable Array modules would go in:
216* `Streamly.Data.Array` -- unpinned, native memory arrays
216* `Streamly.Data.Array` -- unpinned, native memory arrays
217* `Streamly.Data.Array.Storable` -- unpinned, unboxed, native memory arrays
217* `Streamly.Data.Array.Storable` -- unpinned, unboxed, native memory arrays
218* `Streamly.Data.Array.Storable.Pinned` -- pinned, unboxed, native memory arrays
218* `Streamly.Data.Array.Storable.Pinned` -- pinned, unboxed, native memory arrays
219−* `Streamly.Data.Array.Storable.Foreign` -- pinned, unboxed, foreign capable arrays
219+* `Streamly.Data.Array.Foreign` -- pinned, unboxed, foreign capable arrays
220
220
221Unboxed arrays, based on `Prim` type class:
221Unboxed arrays, based on `Prim` type class:
222
222
design/optimization-guidelines.md+1−1
@@ -317,7 +317,7 @@ consume as arguments. This means `StreamD` combinators should not be marked
317as `INLINE` or `INLINE_EARLY`, instead they should all be marked as
317as `INLINE` or `INLINE_EARLY`, instead they should all be marked as
318`INLINE_NORMAL` because higher order functions like `concatMap`/`map`/`mapM`
318`INLINE_NORMAL` because higher order functions like `concatMap`/`map`/`mapM`
319etc are marked as `INLINE_NORMAL`. `StreamD` functions in other modules like
319etc are marked as `INLINE_NORMAL`. `StreamD` functions in other modules like
320−`Streamly.Data.Array.Storable.Foreign` should also follow the same rules.
320+`Streamly.Data.Array.Foreign` should also follow the same rules.
321
321
322## Stream Fusion
322## Stream Fusion
323
323
hie.yaml+2−2
@@ -48,8 +48,8 @@ cradle:
48 cabal:
48 cabal:
49 - path: "./test/Streamly/Test/Data/Array.hs"
49 - path: "./test/Streamly/Test/Data/Array.hs"
50 component: "test:Data.Array"
50 component: "test:Data.Array"
51− - path: "./test/Streamly/Test/Data/Array/Storable/Foreign.hs"
51+ - path: "./test/Streamly/Test/Data/Array/Foreign.hs"
52− component: "Data.Array.Storable.Foreign"
52+ component: "Data.Array.Foreign"
53 - path: "./test/Streamly/Test/Data/Fold.hs"
53 - path: "./test/Streamly/Test/Data/Fold.hs"
54 component: "test:Data.Fold"
54 component: "test:Data.Fold"
55 - path: "./test/Streamly/Test/Data/List.hs"
55 - path: "./test/Streamly/Test/Data/List.hs"
src/Streamly.hs+2−2
@@ -244,7 +244,7 @@ import qualified Streamly.Internal.Data.Stream.Async as Async
244-- > S.length $ S.splitOnSuffix FL.drain 10 $ FH.read fh
244-- > S.length $ S.splitOnSuffix FL.drain 10 $ FH.read fh
245--
245--
246-- The following example folds the lines to arrays of 'Word8' using the
246-- The following example folds the lines to arrays of 'Word8' using the
247−-- 'Streamly.Data.Array.Storable.Foreign.writeF' fold and then wraps the lines in square
247+-- 'Streamly.Data.Array.Foreign.writeF' fold and then wraps the lines in square
248-- brackets before writing them to standard output using
248-- brackets before writing them to standard output using
249-- 'Streamly.FileSystem.Handle.write':
249-- 'Streamly.FileSystem.Handle.write':
250--
250--
@@ -295,7 +295,7 @@ import qualified Streamly.Internal.Data.Stream.Async as Async
295
295
296-- $arrays
296-- $arrays
297--
297--
298−-- Streamly arrays (See "Streamly.Data.Array.Storable.Foreign") complement streams to provide an
298+-- Streamly arrays (See "Streamly.Data.Array.Foreign") complement streams to provide an
299-- efficient computing paradigm. Streams are suitable for immutable
299-- efficient computing paradigm. Streams are suitable for immutable
300-- transformations of /potentially infinite/ data using /sequential access/ and
300-- transformations of /potentially infinite/ data using /sequential access/ and
301-- pipelined transformations whereas arrays are suitable for in-place
301-- pipelined transformations whereas arrays are suitable for in-place
src/Streamly/Data/Array/Storable/Foreign.hs → src/Streamly/Data/Array/Foreign.hsrenamed+4−4
@@ -1,7 +1,7 @@
1#include "inline.hs"
1#include "inline.hs"
2
2
3-- |
3-- |
4−-- Module : Streamly.Data.Array.Storable.Foreign
4+-- Module : Streamly.Data.Array.Foreign
5-- Copyright : (c) 2019 Composewell Technologies
5-- Copyright : (c) 2019 Composewell Technologies
6--
6--
7-- License : BSD3
7-- License : BSD3
@@ -32,9 +32,9 @@
32--
32--
33-- > import qualified Streamly.Array as A
33-- > import qualified Streamly.Array as A
34--
34--
35−-- For experimental APIs see "Streamly.Internal.Data.Array.Storable.Foreign".
35+-- For experimental APIs see "Streamly.Internal.Data.Array.Foreign".
36
36
37−module Streamly.Data.Array.Storable.Foreign
37+module Streamly.Data.Array.Foreign
38 (
38 (
39 A.Array
39 A.Array
40
40
@@ -70,4 +70,4 @@ module Streamly.Data.Array.Storable.Foreign
70 )
70 )
71where
71where
72
72
73−import Streamly.Internal.Data.Array.Storable.Foreign as A
73+import Streamly.Internal.Data.Array.Foreign as A
src/Streamly/Data/Unicode/Stream.hs+3−3
@@ -12,11 +12,11 @@
12-- A 'Char' stream is the canonical representation to process Unicode strings.
12-- A 'Char' stream is the canonical representation to process Unicode strings.
13-- It can be processed efficiently using regular stream processing operations.
13-- It can be processed efficiently using regular stream processing operations.
14-- A byte stream of Unicode text read from an IO device or from an
14-- A byte stream of Unicode text read from an IO device or from an
15−-- 'Streamly.Data.Array.Storable.Foreign.Array' in memory can be decoded into a 'Char' stream
15+-- 'Streamly.Data.Array.Foreign.Array' in memory can be decoded into a 'Char' stream
16-- using the decoding routines in this module. A 'String' (@[Char]@) can be
16-- using the decoding routines in this module. A 'String' (@[Char]@) can be
17-- converted into a 'Char' stream using 'Streamly.Prelude.fromList'. An @Array
17-- converted into a 'Char' stream using 'Streamly.Prelude.fromList'. An @Array
18-- Char@ can be 'Streamly.Prelude.unfold'ed into a stream using the array
18-- Char@ can be 'Streamly.Prelude.unfold'ed into a stream using the array
19−-- 'Streamly.Data.Array.Storable.Foreign.read' unfold.
19+-- 'Streamly.Data.Array.Foreign.read' unfold.
20--
20--
21-- = Storing Unicode Strings
21-- = Storing Unicode Strings
22--
22--
@@ -30,7 +30,7 @@
30-- than pinned arrays for short and short lived strings.
30-- than pinned arrays for short and short lived strings.
31--
31--
32-- For longer or long lived streams you can 'Streamly.Prelude.fold' the 'Char'
32-- For longer or long lived streams you can 'Streamly.Prelude.fold' the 'Char'
33−-- stream as @Array Char@ using the array 'Streamly.Data.Array.Storable.Foreign.write' fold.
33+-- stream as @Array Char@ using the array 'Streamly.Data.Array.Foreign.write' fold.
34-- The 'Array' type provides a more compact representation and pinned memory
34-- The 'Array' type provides a more compact representation and pinned memory
35-- reducing GC overhead. If space efficiency is a concern you can use
35-- reducing GC overhead. If space efficiency is a concern you can use
36-- 'encodeUtf8'' on the 'Char' stream before writing it to an 'Array' providing
36-- 'encodeUtf8'' on the 'Char' stream before writing it to an 'Array' providing
src/Streamly/FileSystem/FD.hs+4−4
@@ -25,7 +25,7 @@
25--
25--
26-- Reading and writing APIs are divided into two categories, sequential
26-- Reading and writing APIs are divided into two categories, sequential
27-- streaming APIs and random or seekable access APIs. File IO APIs are quite
27-- streaming APIs and random or seekable access APIs. File IO APIs are quite
28−-- similar to "Streamly.Data.Array.Storable.Foreign" read write APIs. In that regard, arrays can
28+-- similar to "Streamly.Data.Array.Foreign" read write APIs. In that regard, arrays can
29-- be considered as in-memory files or files can be considered as on-disk
29-- be considered as in-memory files or files can be considered as on-disk
30-- arrays.
30-- arrays.
31--
31--
@@ -130,8 +130,8 @@ import Prelude hiding (read)
130import qualified GHC.IO.FD as FD
130import qualified GHC.IO.FD as FD
131import qualified GHC.IO.Device as RawIO
131import qualified GHC.IO.Device as RawIO
132
132
133−import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..), byteLength, defaultChunkSize, unsafeFreeze)
133+import Streamly.Internal.Data.Array.Foreign.Types (Array(..), byteLength, defaultChunkSize, unsafeFreeze)
134−import Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types (mutableArray)
134+import Streamly.Internal.Data.Array.Foreign.Mut.Types (mutableArray)
135
135
136import Streamly.Internal.Data.Stream.Serial (SerialT)
136import Streamly.Internal.Data.Stream.Serial (SerialT)
137import Streamly.Internal.Data.Stream.StreamK.Type (IsStream, mkStream)
137import Streamly.Internal.Data.Stream.StreamK.Type (IsStream, mkStream)
@@ -145,7 +145,7 @@ import qualified Streamly.FileSystem.FDIO as RawIO hiding (write)
145-- import Streamly.Data.Fold (Fold)
145-- import Streamly.Data.Fold (Fold)
146-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
146-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
147
147
148−import qualified Streamly.Data.Array.Storable.Foreign as A
148+import qualified Streamly.Data.Array.Foreign as A
149import qualified Streamly.Internal.Memory.ArrayStream as AS
149import qualified Streamly.Internal.Memory.ArrayStream as AS
150import qualified Streamly.Prelude as S
150import qualified Streamly.Prelude as S
151import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
151import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
src/Streamly/FileSystem/Handle.hs+3−3
@@ -10,7 +10,7 @@
10-- Portability : GHC
10-- Portability : GHC
11--
11--
12-- Read and write streams and arrays to and from file handles. File handle IO
12-- Read and write streams and arrays to and from file handles. File handle IO
13−-- APIs are quite similar to "Streamly.Data.Array.Storable.Foreign" read write APIs. In that
13+-- APIs are quite similar to "Streamly.Data.Array.Foreign" read write APIs. In that
14-- regard, arrays can be considered as in-memory files or files can be
14-- regard, arrays can be considered as in-memory files or files can be
15-- considered as on-disk arrays.
15-- considered as on-disk arrays.
16--
16--
@@ -44,12 +44,12 @@ module Streamly.FileSystem.Handle
44 -- the stream is lazy and generated on-demand as the consumer consumes it.
44 -- the stream is lazy and generated on-demand as the consumer consumes it.
45 -- Read IO requests to the IO device are performed in chunks limited to a
45 -- Read IO requests to the IO device are performed in chunks limited to a
46 -- maximum size of 32KiB, this is referred to as
46 -- maximum size of 32KiB, this is referred to as
47− -- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize' in the
47+ -- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' in the
48 -- documentation. One IO request may or may not read the full
48 -- documentation. One IO request may or may not read the full
49 -- chunk. If the whole stream is not consumed, it is possible that we may
49 -- chunk. If the whole stream is not consumed, it is possible that we may
50 -- read slightly more from the IO device than what the consumer needed.
50 -- read slightly more from the IO device than what the consumer needed.
51 -- Unless specified otherwise in the API, writes are collected into chunks
51 -- Unless specified otherwise in the API, writes are collected into chunks
52− -- of 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize' before they
52+ -- of 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before they
53 -- are written to the IO device.
53 -- are written to the IO device.
54
54
55 -- Streaming APIs work for all kind of devices, seekable or non-seekable;
55 -- Streaming APIs work for all kind of devices, seekable or non-seekable;
src/Streamly/Internal/Data/Array/Storable/Foreign.hs → src/Streamly/Internal/Data/Array/Foreign.hsrenamed+5−5
@@ -3,7 +3,7 @@
3#include "inline.hs"
3#include "inline.hs"
4
4
5-- |
5-- |
6−-- Module : Streamly.Internal.Data.Array.Storable.Foreign
6+-- Module : Streamly.Internal.Data.Array.Foreign
7-- Copyright : (c) 2019 Composewell Technologies
7-- Copyright : (c) 2019 Composewell Technologies
8--
8--
9-- License : BSD3
9-- License : BSD3
@@ -32,7 +32,7 @@
32-- if we use one array for each chunk. This is still significant to add
32-- if we use one array for each chunk. This is still significant to add
33-- pressure to GC.
33-- pressure to GC.
34
34
35−module Streamly.Internal.Data.Array.Storable.Foreign
35+module Streamly.Internal.Data.Array.Foreign
36 (
36 (
37 Array
37 Array
38
38
@@ -156,14 +156,14 @@ import GHC.Ptr (Ptr(..))
156import GHC.Prim (touch#)
156import GHC.Prim (touch#)
157import GHC.IO (IO(..))
157import GHC.IO (IO(..))
158
158
159−import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..), length)
159+import Streamly.Internal.Data.Array.Foreign.Types (Array(..), length)
160import Streamly.Internal.Data.Fold.Types (Fold(..))
160import Streamly.Internal.Data.Fold.Types (Fold(..))
161import Streamly.Internal.Data.Stream.Serial (SerialT)
161import Streamly.Internal.Data.Stream.Serial (SerialT)
162import Streamly.Internal.Data.Tuple.Strict (Tuple3'(..))
162import Streamly.Internal.Data.Tuple.Strict (Tuple3'(..))
163import Streamly.Internal.Data.Unfold.Types (Unfold(..))
163import Streamly.Internal.Data.Unfold.Types (Unfold(..))
164
164
165−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types as MA
165+import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
166−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
166+import qualified Streamly.Internal.Data.Array.Foreign.Types as A
167import qualified Streamly.Internal.Data.Fold as FL
167import qualified Streamly.Internal.Data.Fold as FL
168import qualified Streamly.Internal.Data.Stream.Prelude as P
168import qualified Streamly.Internal.Data.Stream.Prelude as P
169import qualified Streamly.Internal.Data.Stream.Serial as Serial
169import qualified Streamly.Internal.Data.Stream.Serial as Serial
src/Streamly/Internal/Data/Array/Storable/Foreign/Mut/Types.hs → src/Streamly/Internal/Data/Array/Foreign/Mut/Types.hsrenamed+3−3
@@ -1,7 +1,7 @@
1{-# LANGUAGE UnboxedTuples #-}
1{-# LANGUAGE UnboxedTuples #-}
2
2
3-- |
3-- |
4−-- Module : Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types
4+-- Module : Streamly.Internal.Data.Array.Foreign.Mut.Types
5-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
6-- License : BSD3-3-Clause
6-- License : BSD3-3-Clause
7-- Maintainer : streamly@composewell.com
7-- Maintainer : streamly@composewell.com
@@ -22,7 +22,7 @@
22-- Stream and Fold APIs allow easy, efficient and convenient operations on
22-- Stream and Fold APIs allow easy, efficient and convenient operations on
23-- arrays.
23-- arrays.
24
24
25−module Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types
25+module Streamly.Internal.Data.Array.Foreign.Mut.Types
26 (
26 (
27 -- * Type
27 -- * Type
28 -- $arrayNotes
28 -- $arrayNotes
@@ -459,7 +459,7 @@ arraysOf n (D.Stream step state) =
459 step' _ (GroupStart st) = do
459 step' _ (GroupStart st) = do
460 when (n <= 0) $
460 when (n <= 0) $
461 -- XXX we can pass the module string from the higher level API
461 -- XXX we can pass the module string from the higher level API
462− error $ "Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types.fromStreamDArraysOf: the size of "
462+ error $ "Streamly.Internal.Data.Array.Foreign.Mut.Types.fromStreamDArraysOf: the size of "
463 ++ "arrays [" ++ show n ++ "] must be a natural number"
463 ++ "arrays [" ++ show n ++ "] must be a natural number"
464 Array start end bound <- liftIO $ newArray n
464 Array start end bound <- liftIO $ newArray n
465 return $ D.Skip (GroupBuffer st start end bound)
465 return $ D.Skip (GroupBuffer st start end bound)
src/Streamly/Internal/Data/Array/Storable/Foreign/Types.hs → src/Streamly/Internal/Data/Array/Foreign/Types.hsrenamed+4−4
@@ -1,7 +1,7 @@
1#include "inline.hs"
1#include "inline.hs"
2
2
3-- |
3-- |
4−-- Module : Streamly.Internal.Data.Array.Storable.Foreign.Types
4+-- Module : Streamly.Internal.Data.Array.Foreign.Types
5-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
6--
6--
7-- License : BSD3-3-Clause
7-- License : BSD3-3-Clause
@@ -9,9 +9,9 @@
9-- Stability : experimental
9-- Stability : experimental
10-- Portability : GHC
10-- Portability : GHC
11--
11--
12−-- See notes in "Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types"
12+-- See notes in "Streamly.Internal.Data.Array.Foreign.Mut.Types"
13--
13--
14−module Streamly.Internal.Data.Array.Storable.Foreign.Types
14+module Streamly.Internal.Data.Array.Foreign.Types
15 (
15 (
16 -- $arrayNotes
16 -- $arrayNotes
17 Array (..)
17 Array (..)
@@ -101,7 +101,7 @@ import Text.Read (readPrec, readListPrec, readListPrecDefault)
101
101
102import Prelude hiding (length, foldr, read, unlines, splitAt)
102import Prelude hiding (length, foldr, read, unlines, splitAt)
103
103
104−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types as MA
104+import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
105import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
105import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
106import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
106import qualified Streamly.Internal.Data.Stream.StreamK.Type as K
107import qualified GHC.Exts as Exts
107import qualified GHC.Exts as Exts
src/Streamly/Internal/Data/Array/Prim/MutTypesInclude.hs+3−3
@@ -266,7 +266,7 @@ fromStreamDArraysOf n (D.Stream step state) = D.Stream step' (GroupStart state)
266 when (n <= 0) $
266 when (n <= 0) $
267 -- XXX we can pass the module string from the higher level API
267 -- XXX we can pass the module string from the higher level API
268 error $
268 error $
269− "Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types.fromStreamDArraysOf: the size of " ++
269+ "Streamly.Internal.Data.Array.Foreign.Mut.Types.fromStreamDArraysOf: the size of " ++
270 "arrays [" ++ show n ++ "] must be a natural number"
270 "arrays [" ++ show n ++ "] must be a natural number"
271 arr <- newArray n
271 arr <- newArray n
272 return $ D.Skip (GroupBuffer st arr 0)
272 return $ D.Skip (GroupBuffer st arr 0)
@@ -319,7 +319,7 @@ packArraysChunksOf n (D.Stream step state) =
319 step' gst (SpliceInitial st) = do
319 step' gst (SpliceInitial st) = do
320 when (n <= 0) $
320 when (n <= 0) $
321 -- XXX we can pass the module string from the higher level API
321 -- XXX we can pass the module string from the higher level API
322− error $ "Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types.packArraysChunksOf: the size of "
322+ error $ "Streamly.Internal.Data.Array.Foreign.Mut.Types.packArraysChunksOf: the size of "
323 ++ "arrays [" ++ show n ++ "] must be a natural number"
323 ++ "arrays [" ++ show n ++ "] must be a natural number"
324 r <- step gst st
324 r <- step gst st
325 case r of
325 case r of
@@ -364,7 +364,7 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
364 when (n <= 0)
364 when (n <= 0)
365 -- XXX we can pass the module string from the higher level API
365 -- XXX we can pass the module string from the higher level API
366 $ error
366 $ error
367− $ "Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types."
367+ $ "Streamly.Internal.Data.Array.Foreign.Mut.Types."
368 ++ "packArraysChunksOf: the size of arrays ["
368 ++ "packArraysChunksOf: the size of arrays ["
369 ++ show n
369 ++ show n
370 ++ "] must be a natural number"
370 ++ "] must be a natural number"
src/Streamly/Internal/Data/Array/Prim/TypesInclude.hs+2−2
@@ -552,7 +552,7 @@ packArraysChunksOf n (D.Stream step state) =
552 step' gst (SpliceInitial st) = do
552 step' gst (SpliceInitial st) = do
553 when (n <= 0) $
553 when (n <= 0) $
554 -- XXX we can pass the module string from the higher level API
554 -- XXX we can pass the module string from the higher level API
555− error $ "Streamly.Internal.Data.Array.Storable.Foreign.Types.packArraysChunksOf: the size of "
555+ error $ "Streamly.Internal.Data.Array.Foreign.Types.packArraysChunksOf: the size of "
556 ++ "arrays [" ++ show n ++ "] must be a natural number"
556 ++ "arrays [" ++ show n ++ "] must be a natural number"
557 r <- step gst st
557 r <- step gst st
558 case r of
558 case r of
@@ -602,7 +602,7 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
602 initial = do
602 initial = do
603 when (n <= 0) $
603 when (n <= 0) $
604 -- XXX we can pass the module string from the higher level API
604 -- XXX we can pass the module string from the higher level API
605− error $ "Streamly.Internal.Data.Array.Storable.Foreign.Types.packArraysChunksOf: the size of "
605+ error $ "Streamly.Internal.Data.Array.Foreign.Types.packArraysChunksOf: the size of "
606 ++ "arrays [" ++ show n ++ "] must be a natural number"
606 ++ "arrays [" ++ show n ++ "] must be a natural number"
607 res <- initial1
607 res <- initial1
608 return $ first (Tuple3' Nothing' 0) res
608 return $ first (Tuple3' Nothing' 0) res
src/Streamly/Internal/Data/Array/Stream/Mut/Foreign.hs+7−7
@@ -37,16 +37,16 @@ import Foreign.Storable (Storable(..))
37import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
37import Foreign.ForeignPtr.Unsafe (unsafeForeignPtrToPtr)
38import Foreign.Ptr (castPtr)
38import Foreign.Ptr (castPtr)
39import Streamly.FileSystem.FDIO (IOVec(..))
39import Streamly.FileSystem.FDIO (IOVec(..))
40−import Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types (length)
40+import Streamly.Internal.Data.Array.Foreign.Mut.Types (length)
41import Streamly.Internal.Data.SVar (adaptState)
41import Streamly.Internal.Data.SVar (adaptState)
42#endif
42#endif
43−import Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types (Array(..))
43+import Streamly.Internal.Data.Array.Foreign.Mut.Types (Array(..))
44import Streamly.Internal.Data.Fold.Types (Fold(..))
44import Streamly.Internal.Data.Fold.Types (Fold(..))
45import Streamly.Internal.Data.Stream.Serial (SerialT)
45import Streamly.Internal.Data.Stream.Serial (SerialT)
46import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
46import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
47import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
47import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
48
48
49−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types as MArray
49+import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MArray
50import qualified Streamly.Internal.Data.Fold.Types as FL
50import qualified Streamly.Internal.Data.Fold.Types as FL
51import qualified Streamly.Internal.Data.Stream.StreamD as D
51import qualified Streamly.Internal.Data.Stream.StreamD as D
52
52
@@ -99,7 +99,7 @@ packArraysChunksOf n (D.Stream step state) =
99 step' gst (SpliceInitial st) = do
99 step' gst (SpliceInitial st) = do
100 when (n <= 0) $
100 when (n <= 0) $
101 -- XXX we can pass the module string from the higher level API
101 -- XXX we can pass the module string from the higher level API
102− error $ "Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types.packArraysChunksOf: the size of "
102+ error $ "Streamly.Internal.Data.Array.Foreign.Mut.Types.packArraysChunksOf: the size of "
103 ++ "arrays [" ++ show n ++ "] must be a natural number"
103 ++ "arrays [" ++ show n ++ "] must be a natural number"
104 r <- step gst st
104 r <- step gst st
105 case r of
105 case r of
@@ -143,7 +143,7 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
143 initial = do
143 initial = do
144 when (n <= 0) $
144 when (n <= 0) $
145 -- XXX we can pass the module string from the higher level API
145 -- XXX we can pass the module string from the higher level API
146− error $ "Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types.packArraysChunksOf: the size of "
146+ error $ "Streamly.Internal.Data.Array.Foreign.Mut.Types.packArraysChunksOf: the size of "
147 ++ "arrays [" ++ show n ++ "] must be a natural number"
147 ++ "arrays [" ++ show n ++ "] must be a natural number"
148
148
149 r <- initial1
149 r <- initial1
@@ -264,11 +264,11 @@ groupIOVecsOf n maxIOVLen (D.Stream step state) =
264 step' gst (GatherInitial st) = do
264 step' gst (GatherInitial st) = do
265 when (n <= 0) $
265 when (n <= 0) $
266 -- XXX we can pass the module string from the higher level API
266 -- XXX we can pass the module string from the higher level API
267− error $ "Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types.groupIOVecsOf: the size of "
267+ error $ "Streamly.Internal.Data.Array.Foreign.Mut.Types.groupIOVecsOf: the size of "
268 ++ "groups [" ++ show n ++ "] must be a natural number"
268 ++ "groups [" ++ show n ++ "] must be a natural number"
269 when (maxIOVLen <= 0) $
269 when (maxIOVLen <= 0) $
270 -- XXX we can pass the module string from the higher level API
270 -- XXX we can pass the module string from the higher level API
271− error $ "Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types.groupIOVecsOf: the number of "
271+ error $ "Streamly.Internal.Data.Array.Foreign.Mut.Types.groupIOVecsOf: the number of "
272 ++ "IOVec entries [" ++ show n ++ "] must be a natural number"
272 ++ "IOVec entries [" ++ show n ++ "] must be a natural number"
273 r <- step (adaptState gst) st
273 r <- step (adaptState gst) st
274 case r of
274 case r of
src/Streamly/Internal/Data/Binary/Decode.hs+1−1
@@ -32,7 +32,7 @@ import Streamly.Internal.Data.Parser (Parser)
32import Streamly.Internal.Data.Maybe.Strict (Maybe'(..))
32import Streamly.Internal.Data.Maybe.Strict (Maybe'(..))
33import Streamly.Internal.Data.Tuple.Strict (Tuple' (..))
33import Streamly.Internal.Data.Tuple.Strict (Tuple' (..))
34
34
35−import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
35+import qualified Streamly.Internal.Data.Array.Foreign as A
36import qualified Streamly.Internal.Data.Parser as PR
36import qualified Streamly.Internal.Data.Parser as PR
37import qualified Streamly.Internal.Data.Parser.ParserD as PRD
37import qualified Streamly.Internal.Data.Parser.ParserD as PRD
38import qualified Streamly.Internal.Data.Parser.ParserK.Types as PRK
38import qualified Streamly.Internal.Data.Parser.ParserK.Types as PRK
src/Streamly/Internal/Data/Fold/Types.hs+1−1
@@ -420,7 +420,7 @@ simplify (Fold2 step inject extract) c =
420-- | Folds the input stream to a list.
420-- | Folds the input stream to a list.
421--
421--
422-- /Warning!/ working on large lists accumulated as buffers in memory could be
422-- /Warning!/ working on large lists accumulated as buffers in memory could be
423−-- very inefficient, consider using "Streamly.Data.Array.Storable.Foreign"
423+-- very inefficient, consider using "Streamly.Data.Array.Foreign"
424-- instead.
424-- instead.
425--
425--
426-- @since 0.7.0
426-- @since 0.7.0
src/Streamly/Internal/Data/Pipe.hs+2−2
@@ -246,7 +246,7 @@ import Prelude
246-- import Streamly.Data.Fold.Types (Fold(..))
246-- import Streamly.Data.Fold.Types (Fold(..))
247import Streamly.Internal.Data.Pipe.Types
247import Streamly.Internal.Data.Pipe.Types
248 (Pipe(..), PipeState(..), Step(..), zipWith, tee, map, compose)
248 (Pipe(..), PipeState(..), Step(..), zipWith, tee, map, compose)
249−-- import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array)
249+-- import Streamly.Internal.Data.Array.Foreign.Types (Array)
250-- import Streamly.Memory.Ring (Ring)
250-- import Streamly.Memory.Ring (Ring)
251-- import Streamly.Internal.Data.Stream.Serial (SerialT)
251-- import Streamly.Internal.Data.Stream.Serial (SerialT)
252-- import Streamly.Internal.Data.Stream.StreamK (IsStream())
252-- import Streamly.Internal.Data.Stream.StreamK (IsStream())
@@ -256,7 +256,7 @@ import Streamly.Internal.Data.Pipe.Types
256
256
257-- import Streamly.Internal.Data.Strict
257-- import Streamly.Internal.Data.Strict
258
258
259−-- import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
259+-- import qualified Streamly.Internal.Data.Array.Foreign.Types as A
260-- import qualified Streamly.Prelude as S
260-- import qualified Streamly.Prelude as S
261-- import qualified Streamly.Internal.Data.Stream.StreamD as D
261-- import qualified Streamly.Internal.Data.Stream.StreamD as D
262-- import qualified Streamly.Internal.Data.Stream.StreamK as K
262-- import qualified Streamly.Internal.Data.Stream.StreamK as K
src/Streamly/Internal/Data/SmallArray.hs+2−2
@@ -103,7 +103,7 @@ foldr f z arr = runIdentity $ D.foldr f z $ toStreamD arr
103-- 'SmallArray'.
103-- 'SmallArray'.
104--
104--
105-- Since we are folding to a 'SmallArray' @n@ should be <= 128, for larger number
105-- Since we are folding to a 'SmallArray' @n@ should be <= 128, for larger number
106−-- of elements use an 'Array' from either "Streamly.Data.Array" or "Streamly.Data.Array.Storable.Foreign".
106+-- of elements use an 'Array' from either "Streamly.Data.Array" or "Streamly.Data.Array.Foreign".
107{-# INLINE_NORMAL writeN #-}
107{-# INLINE_NORMAL writeN #-}
108writeN :: MonadIO m => Int -> Fold m a (SmallArray a)
108writeN :: MonadIO m => Int -> Fold m a (SmallArray a)
109writeN limit = Fold step initial extract
109writeN limit = Fold step initial extract
@@ -139,7 +139,7 @@ fromStreamDN limit str = do
139--
139--
140-- It is recommended to use a value of @n@ <= 128. For larger sized
140-- It is recommended to use a value of @n@ <= 128. For larger sized
141-- arrays, use an 'Array' from "Streamly.Data.Array" or
141-- arrays, use an 'Array' from "Streamly.Data.Array" or
142−-- "Streamly.Data.Array.Storable.Foreign"
142+-- "Streamly.Data.Array.Foreign"
143{-# INLINABLE fromListN #-}
143{-# INLINABLE fromListN #-}
144fromListN :: Int -> [a] -> SmallArray a
144fromListN :: Int -> [a] -> SmallArray a
145fromListN n xs = unsafePerformIO $ fromStreamDN n $ D.fromList xs
145fromListN n xs = unsafePerformIO $ fromStreamDN n $ D.fromList xs
src/Streamly/Internal/Data/Stream/IsStream/Common.hs+1−1
@@ -48,7 +48,7 @@ where
48import Control.Concurrent (threadDelay)
48import Control.Concurrent (threadDelay)
49import Control.Monad.IO.Class (MonadIO(..))
49import Control.Monad.IO.Class (MonadIO(..))
50import Foreign.Storable (Storable)
50import Foreign.Storable (Storable)
51−import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array)
51+import Streamly.Internal.Data.Array.Foreign.Types (Array)
52import Streamly.Internal.Data.Fold.Types (Fold (..))
52import Streamly.Internal.Data.Fold.Types (Fold (..))
53import Streamly.Internal.Data.Stream.IsStream.Combinators (maxYields)
53import Streamly.Internal.Data.Stream.IsStream.Combinators (maxYields)
54import Streamly.Internal.Data.Stream.Prelude (fromStreamS, toStreamS)
54import Streamly.Internal.Data.Stream.Prelude (fromStreamS, toStreamS)
src/Streamly/Internal/Data/Stream/IsStream/Eliminate.hs+1−1
@@ -162,7 +162,7 @@ import Streamly.Internal.Data.Stream.StreamD (fromStreamD, toStreamD)
162import Streamly.Internal.Data.Stream.StreamK (IsStream)
162import Streamly.Internal.Data.Stream.StreamK (IsStream)
163import Streamly.Internal.Data.Stream.Serial (SerialT)
163import Streamly.Internal.Data.Stream.Serial (SerialT)
164
164
165−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
165+import qualified Streamly.Internal.Data.Array.Foreign.Types as A
166import qualified Streamly.Internal.Data.Fold as FL
166import qualified Streamly.Internal.Data.Fold as FL
167import qualified Streamly.Internal.Data.Stream.Parallel as Par
167import qualified Streamly.Internal.Data.Stream.Parallel as Par
168import qualified Streamly.Internal.Data.Stream.Prelude as P
168import qualified Streamly.Internal.Data.Stream.Prelude as P
src/Streamly/Internal/Data/Stream/IsStream/Nesting.hs+2−2
@@ -254,7 +254,7 @@ import Foreign.Storable (Storable)
254import Streamly.Internal.Data.Fold.Types (Fold (..), Fold2 (..))
254import Streamly.Internal.Data.Fold.Types (Fold (..), Fold2 (..))
255import Streamly.Internal.Data.Parser (Parser (..))
255import Streamly.Internal.Data.Parser (Parser (..))
256import Streamly.Internal.Data.Unfold.Types (Unfold)
256import Streamly.Internal.Data.Unfold.Types (Unfold)
257−import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array)
257+import Streamly.Internal.Data.Array.Foreign.Types (Array)
258import Streamly.Internal.Data.SVar (MonadAsync)
258import Streamly.Internal.Data.SVar (MonadAsync)
259import Streamly.Internal.Data.Stream.Ahead (ahead)
259import Streamly.Internal.Data.Stream.Ahead (ahead)
260import Streamly.Internal.Data.Stream.Async (async, wAsync)
260import Streamly.Internal.Data.Stream.Async (async, wAsync)
@@ -284,7 +284,7 @@ import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
284
284
285import qualified Data.Heap as H
285import qualified Data.Heap as H
286import qualified Data.Map.Strict as Map
286import qualified Data.Map.Strict as Map
287−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
287+import qualified Streamly.Internal.Data.Array.Foreign.Types as A
288import qualified Streamly.Internal.Data.Fold as FL
288import qualified Streamly.Internal.Data.Fold as FL
289import qualified Streamly.Internal.Data.Parser.ParserK.Types as PRK
289import qualified Streamly.Internal.Data.Parser.ParserK.Types as PRK
290import qualified Streamly.Internal.Data.Parser.ParserD as PRD
290import qualified Streamly.Internal.Data.Parser.ParserD as PRD
src/Streamly/Internal/Data/Stream/StreamD/Nesting.hs+2−2
@@ -156,12 +156,12 @@ import Foreign.Storable (Storable(..))
156import Fusion.Plugin.Types (Fuse(..))
156import Fusion.Plugin.Types (Fuse(..))
157import GHC.Types (SPEC(..))
157import GHC.Types (SPEC(..))
158
158
159−import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..))
159+import Streamly.Internal.Data.Array.Foreign.Types (Array(..))
160import Streamly.Internal.Data.Fold.Types (Fold(..))
160import Streamly.Internal.Data.Fold.Types (Fold(..))
161import Streamly.Internal.Data.Parser (ParseError(..))
161import Streamly.Internal.Data.Parser (ParseError(..))
162import Streamly.Internal.Data.Unfold.Types (Unfold(..))
162import Streamly.Internal.Data.Unfold.Types (Unfold(..))
163
163
164−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
164+import qualified Streamly.Internal.Data.Array.Foreign.Types as A
165import qualified Streamly.Internal.Data.Fold as FL
165import qualified Streamly.Internal.Data.Fold as FL
166import qualified Streamly.Internal.Data.Parser as PR
166import qualified Streamly.Internal.Data.Parser as PR
167import qualified Streamly.Internal.Data.Parser.ParserD as PRD
167import qualified Streamly.Internal.Data.Parser.ParserD as PRD
src/Streamly/Internal/Data/Stream/StreamD/Transform.hs+1−1
@@ -139,7 +139,7 @@ import Streamly.Internal.Data.Time.Clock (Clock(Monotonic), getTime)
139import Streamly.Internal.Data.Time.Units
139import Streamly.Internal.Data.Time.Units
140 (TimeUnit64, toRelTime64, diffAbsTime64)
140 (TimeUnit64, toRelTime64, diffAbsTime64)
141
141
142−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
142+import qualified Streamly.Internal.Data.Array.Foreign.Types as A
143import qualified Streamly.Internal.Data.Fold as FL
143import qualified Streamly.Internal.Data.Fold as FL
144import qualified Streamly.Internal.Data.IORef.Prim as Prim
144import qualified Streamly.Internal.Data.IORef.Prim as Prim
145import qualified Streamly.Internal.Data.Pipe.Types as Pipe
145import qualified Streamly.Internal.Data.Pipe.Types as Pipe
src/Streamly/Internal/FileSystem/Dir.hs+6−6
@@ -64,7 +64,7 @@ import Prelude hiding (read)
64-- import Streamly.Data.Fold (Fold)
64-- import Streamly.Data.Fold (Fold)
65import Streamly.Internal.BaseCompat (fromLeft, fromRight)
65import Streamly.Internal.BaseCompat (fromLeft, fromRight)
66import Streamly.Internal.Data.Unfold.Types (Unfold(..))
66import Streamly.Internal.Data.Unfold.Types (Unfold(..))
67−-- import Streamly.Internal.Data.Array.Storable.Foreign.Types
67+-- import Streamly.Internal.Data.Array.Foreign.Types
68-- (Array(..), writeNUnsafe, defaultChunkSize, shrinkToFit,
68-- (Array(..), writeNUnsafe, defaultChunkSize, shrinkToFit,
69-- lpackArraysChunksOf)
69-- lpackArraysChunksOf)
70-- import Streamly.Internal.Data.Stream.Serial (SerialT)
70-- import Streamly.Internal.Data.Stream.Serial (SerialT)
@@ -76,7 +76,7 @@ import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
76import qualified Streamly.Internal.Data.Unfold as UF
76import qualified Streamly.Internal.Data.Unfold as UF
77-- import qualified Streamly.Internal.Memory.ArrayStream as AS
77-- import qualified Streamly.Internal.Memory.ArrayStream as AS
78import qualified Streamly.Internal.Data.Stream.IsStream as S
78import qualified Streamly.Internal.Data.Stream.IsStream as S
79−-- import qualified Streamly.Data.Array.Storable.Foreign as A
79+-- import qualified Streamly.Data.Array.Foreign as A
80-- import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
80-- import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
81import qualified System.Directory as Dir
81import qualified System.Directory as Dir
82
82
@@ -166,9 +166,9 @@ toChunks = toChunksWithBufferOf defaultChunkSize
166
166
167-- | Unfolds a handle into a stream of 'Word8' arrays. Requests to the IO
167-- | Unfolds a handle into a stream of 'Word8' arrays. Requests to the IO
168-- device are performed using a buffer of size
168-- device are performed using a buffer of size
169−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'. The
169+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'. The
170-- size of arrays in the resulting stream are therefore less than or equal to
170-- size of arrays in the resulting stream are therefore less than or equal to
171−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'.
171+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
172--
172--
173-- @since 0.7.0
173-- @since 0.7.0
174{-# INLINE readChunks #-}
174{-# INLINE readChunks #-}
@@ -343,7 +343,7 @@ fromStreamWithBufferOf n h m = fromChunks h $ S.arraysOf n m
343-- > write = 'writeWithBufferOf' A.defaultChunkSize
343-- > write = 'writeWithBufferOf' A.defaultChunkSize
344--
344--
345-- | Write a byte stream to a file handle. Accumulates the input in chunks of
345-- | Write a byte stream to a file handle. Accumulates the input in chunks of
346−-- up to 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize' before writing.
346+-- up to 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before writing.
347--
347--
348-- NOTE: This may perform better than the 'write' fold, you can try this if you
348-- NOTE: This may perform better than the 'write' fold, you can try this if you
349-- need some extra perf boost.
349-- need some extra perf boost.
@@ -393,7 +393,7 @@ writeWithBufferOf n h = FL.chunksOf n (writeNUnsafe n) (writeChunks h)
393-- > write = 'writeWithBufferOf' A.defaultChunkSize
393-- > write = 'writeWithBufferOf' A.defaultChunkSize
394--
394--
395-- | Write a byte stream to a file handle. Accumulates the input in chunks of
395-- | Write a byte stream to a file handle. Accumulates the input in chunks of
396−-- up to 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize' before writing
396+-- up to 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before writing
397-- to the IO device.
397-- to the IO device.
398--
398--
399-- @since 0.7.0
399-- @since 0.7.0
src/Streamly/Internal/FileSystem/Event/Darwin.hs+2−2
@@ -165,7 +165,7 @@ import GHC.IO.Handle.FD (fdToHandle)
165import Streamly.Prelude (SerialT)
165import Streamly.Prelude (SerialT)
166import Streamly.Internal.Data.Cont (contListMap)
166import Streamly.Internal.Data.Cont (contListMap)
167import Streamly.Internal.Data.Parser (Parser)
167import Streamly.Internal.Data.Parser (Parser)
168−import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..))
168+import Streamly.Internal.Data.Array.Foreign.Types (Array(..))
169import System.IO (Handle, hClose)
169import System.IO (Handle, hClose)
170
170
171import qualified Data.List.NonEmpty as NonEmpty
171import qualified Data.List.NonEmpty as NonEmpty
@@ -173,7 +173,7 @@ import qualified Streamly.Internal.Data.Parser as PR
173import qualified Streamly.Internal.Data.Stream.IsStream as S
173import qualified Streamly.Internal.Data.Stream.IsStream as S
174import qualified Streamly.Internal.Unicode.Stream as U
174import qualified Streamly.Internal.Unicode.Stream as U
175import qualified Streamly.Internal.FileSystem.Handle as FH
175import qualified Streamly.Internal.FileSystem.Handle as FH
176−import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
176+import qualified Streamly.Internal.Data.Array.Foreign as A
177
177
178-------------------------------------------------------------------------------
178-------------------------------------------------------------------------------
179-- Subscription to events
179-- Subscription to events
src/Streamly/Internal/FileSystem/Event/Linux.hs+2−2
@@ -171,7 +171,7 @@ import GHC.IO.FD (fdFD, mkFD)
171import GHC.IO.Handle.FD (mkHandleFromFD)
171import GHC.IO.Handle.FD (mkHandleFromFD)
172import Streamly.Prelude (SerialT)
172import Streamly.Prelude (SerialT)
173import Streamly.Internal.Data.Parser (Parser)
173import Streamly.Internal.Data.Parser (Parser)
174−import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..))
174+import Streamly.Internal.Data.Array.Foreign.Types (Array(..))
175import System.IO (Handle, hClose, IOMode(ReadMode))
175import System.IO (Handle, hClose, IOMode(ReadMode))
176#if !MIN_VERSION_base(4,10,0)
176#if !MIN_VERSION_base(4,10,0)
177import Control.Concurrent.MVar (readMVar)
177import Control.Concurrent.MVar (readMVar)
@@ -185,7 +185,7 @@ import GHC.IO.Handle.FD (handleToFd)
185
185
186import qualified Data.IntMap.Lazy as Map
186import qualified Data.IntMap.Lazy as Map
187import qualified Data.List.NonEmpty as NonEmpty
187import qualified Data.List.NonEmpty as NonEmpty
188−import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
188+import qualified Streamly.Internal.Data.Array.Foreign as A
189import qualified Streamly.Internal.Data.Fold as FL
189import qualified Streamly.Internal.Data.Fold as FL
190import qualified Streamly.Internal.Data.Parser as PR
190import qualified Streamly.Internal.Data.Parser as PR
191import qualified Streamly.Internal.Data.Stream.IsStream as S
191import qualified Streamly.Internal.Data.Stream.IsStream as S
src/Streamly/Internal/FileSystem/Event/Windows.hs+2−2
@@ -124,8 +124,8 @@ import System.Win32.Types (BOOL, DWORD, HANDLE, LPVOID, LPDWORD, failIfFalse_)
124import qualified Data.List.NonEmpty as NonEmpty
124import qualified Data.List.NonEmpty as NonEmpty
125import qualified Streamly.Internal.Data.Stream.IsStream as S
125import qualified Streamly.Internal.Data.Stream.IsStream as S
126import qualified Streamly.Internal.Unicode.Stream as U
126import qualified Streamly.Internal.Unicode.Stream as U
127−import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
127+import qualified Streamly.Internal.Data.Array.Foreign as A
128−import Streamly.Internal.Data.Array.Storable.Foreign (Array)
128+import Streamly.Internal.Data.Array.Foreign (Array)
129
129
130-- | Watch configuration, used to specify the events of interest and the
130-- | Watch configuration, used to specify the events of interest and the
131-- behavior of the watch.
131-- behavior of the watch.
src/Streamly/Internal/FileSystem/File.hs+6−6
@@ -96,7 +96,7 @@ import qualified System.IO as SIO
96
96
97import Streamly.Internal.Data.Fold.Types (Fold(..))
97import Streamly.Internal.Data.Fold.Types (Fold(..))
98import Streamly.Internal.Data.Unfold.Types (Unfold(..))
98import Streamly.Internal.Data.Unfold.Types (Unfold(..))
99−import Streamly.Internal.Data.Array.Storable.Foreign.Types
99+import Streamly.Internal.Data.Array.Foreign.Types
100 (Array(..), defaultChunkSize, writeNUnsafe)
100 (Array(..), defaultChunkSize, writeNUnsafe)
101import Streamly.Internal.Data.Stream.Serial (SerialT)
101import Streamly.Internal.Data.Stream.Serial (SerialT)
102import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
102import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
@@ -108,7 +108,7 @@ import qualified Streamly.Internal.Data.Fold.Types as FL
108import qualified Streamly.Internal.Data.Unfold as UF
108import qualified Streamly.Internal.Data.Unfold as UF
109import qualified Streamly.Internal.FileSystem.Handle as FH
109import qualified Streamly.Internal.FileSystem.Handle as FH
110import qualified Streamly.Internal.Memory.ArrayStream as AS
110import qualified Streamly.Internal.Memory.ArrayStream as AS
111−import qualified Streamly.Data.Array.Storable.Foreign as A
111+import qualified Streamly.Data.Array.Foreign as A
112import qualified Streamly.Prelude as S
112import qualified Streamly.Prelude as S
113
113
114-------------------------------------------------------------------------------
114-------------------------------------------------------------------------------
@@ -243,9 +243,9 @@ readChunksWithBufferOf = usingFile2 FH.readChunksWithBufferOf
243
243
244-- | Unfolds a 'FilePath' into a stream of 'Word8' arrays. Requests to the IO
244-- | Unfolds a 'FilePath' into a stream of 'Word8' arrays. Requests to the IO
245-- device are performed using a buffer of size
245-- device are performed using a buffer of size
246−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'. The
246+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'. The
247-- size of arrays in the resulting stream are therefore less than or equal to
247-- size of arrays in the resulting stream are therefore less than or equal to
248−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'.
248+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
249--
249--
250-- /Internal/
250-- /Internal/
251{-# INLINE readChunks #-}
251{-# INLINE readChunks #-}
@@ -262,7 +262,7 @@ readWithBufferOf = usingFile2 FH.readWithBufferOf
262
262
263-- | Unfolds a file path into a byte stream. IO requests to the device are
263-- | Unfolds a file path into a byte stream. IO requests to the device are
264-- performed in sizes of
264-- performed in sizes of
265−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'.
265+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
266--
266--
267-- @since 0.7.0
267-- @since 0.7.0
268{-# INLINE read #-}
268{-# INLINE read #-}
@@ -382,7 +382,7 @@ writeWithBufferOf n path =
382-- > write = 'writeWithBufferOf' A.defaultChunkSize
382-- > write = 'writeWithBufferOf' A.defaultChunkSize
383--
383--
384-- | Write a byte stream to a file. Accumulates the input in chunks of up to
384-- | Write a byte stream to a file. Accumulates the input in chunks of up to
385−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize' before writing to
385+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before writing to
386-- the IO device.
386-- the IO device.
387--
387--
388-- /Internal/
388-- /Internal/
src/Streamly/Internal/FileSystem/Handle.hs+9−9
@@ -113,9 +113,9 @@ import Streamly.Prelude (MonadAsync)
113import Streamly.Data.Fold (Fold)
113import Streamly.Data.Fold (Fold)
114import Streamly.Internal.Data.Fold.Types (Fold2(..))
114import Streamly.Internal.Data.Fold.Types (Fold2(..))
115import Streamly.Internal.Data.Unfold.Types (Unfold(..))
115import Streamly.Internal.Data.Unfold.Types (Unfold(..))
116−import Streamly.Internal.Data.Array.Storable.Foreign.Types
116+import Streamly.Internal.Data.Array.Foreign.Types
117 (Array(..), writeNUnsafe, defaultChunkSize , unsafeFreezeWithShrink)
117 (Array(..), writeNUnsafe, defaultChunkSize , unsafeFreezeWithShrink)
118−import Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types (mutableArray)
118+import Streamly.Internal.Data.Array.Foreign.Mut.Types (mutableArray)
119import Streamly.Internal.Data.Stream.Serial (SerialT)
119import Streamly.Internal.Data.Stream.Serial (SerialT)
120import Streamly.Internal.Data.Stream.StreamK.Type (IsStream, mkStream)
120import Streamly.Internal.Data.Stream.StreamK.Type (IsStream, mkStream)
121import Streamly.Internal.Memory.ArrayStream (lpackArraysChunksOf)
121import Streamly.Internal.Memory.ArrayStream (lpackArraysChunksOf)
@@ -124,10 +124,10 @@ import Streamly.Internal.Memory.ArrayStream (lpackArraysChunksOf)
124import qualified Streamly.Data.Fold as FL
124import qualified Streamly.Data.Fold as FL
125import qualified Streamly.Internal.Data.Fold.Types as FL
125import qualified Streamly.Internal.Data.Fold.Types as FL
126import qualified Streamly.Internal.Data.Unfold as UF
126import qualified Streamly.Internal.Data.Unfold as UF
127−import qualified Streamly.Internal.Data.Array.Storable.Foreign as IA
127+import qualified Streamly.Internal.Data.Array.Foreign as IA
128import qualified Streamly.Internal.Memory.ArrayStream as AS
128import qualified Streamly.Internal.Memory.ArrayStream as AS
129import qualified Streamly.Internal.Data.Stream.IsStream as S
129import qualified Streamly.Internal.Data.Stream.IsStream as S
130−import qualified Streamly.Data.Array.Storable.Foreign as A
130+import qualified Streamly.Data.Array.Foreign as A
131import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
131import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
132
132
133-------------------------------------------------------------------------------
133-------------------------------------------------------------------------------
@@ -255,9 +255,9 @@ getBytes = toBytes stdin
255
255
256-- | Unfolds a handle into a stream of 'Word8' arrays. Requests to the IO
256-- | Unfolds a handle into a stream of 'Word8' arrays. Requests to the IO
257-- device are performed using a buffer of size
257-- device are performed using a buffer of size
258−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'. The
258+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'. The
259-- size of arrays in the resulting stream are therefore less than or equal to
259-- size of arrays in the resulting stream are therefore less than or equal to
260−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'.
260+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
261--
261--
262-- @since 0.7.0
262-- @since 0.7.0
263{-# INLINE readChunks #-}
263{-# INLINE readChunks #-}
@@ -294,7 +294,7 @@ toBytesWithBufferOf chunkSize h = AS.concat $ toChunksWithBufferOf chunkSize h
294--
294--
295-- | Unfolds a file handle into a byte stream. IO requests to the device are
295-- | Unfolds a file handle into a byte stream. IO requests to the device are
296-- performed in sizes of
296-- performed in sizes of
297−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'.
297+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
298--
298--
299-- @since 0.7.0
299-- @since 0.7.0
300{-# INLINE read #-}
300{-# INLINE read #-}
@@ -411,7 +411,7 @@ fromBytesWithBufferOf n h m = fromChunks h $ S.arraysOf n m
411-- > write = 'writeWithBufferOf' A.defaultChunkSize
411-- > write = 'writeWithBufferOf' A.defaultChunkSize
412--
412--
413-- | Write a byte stream to a file handle. Accumulates the input in chunks of
413-- | Write a byte stream to a file handle. Accumulates the input in chunks of
414−-- up to 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize' before writing.
414+-- up to 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before writing.
415--
415--
416-- NOTE: This may perform better than the 'write' fold, you can try this if you
416-- NOTE: This may perform better than the 'write' fold, you can try this if you
417-- need some extra perf boost.
417-- need some extra perf boost.
@@ -469,7 +469,7 @@ writeWithBufferOf2 n = FL.chunksOf2 n (writeNUnsafe n) writeChunks2
469-- > write = 'writeWithBufferOf' A.defaultChunkSize
469-- > write = 'writeWithBufferOf' A.defaultChunkSize
470--
470--
471-- | Write a byte stream to a file handle. Accumulates the input in chunks of
471-- | Write a byte stream to a file handle. Accumulates the input in chunks of
472−-- up to 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize' before writing
472+-- up to 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before writing
473-- to the IO device.
473-- to the IO device.
474--
474--
475-- @since 0.7.0
475-- @since 0.7.0
src/Streamly/Internal/Memory/ArrayStream.hs+4−4
@@ -52,15 +52,15 @@ import Prelude hiding (length, null, last, map, (!!), read, concat, unlines)
52#if !defined(mingw32_HOST_OS)
52#if !defined(mingw32_HOST_OS)
53import Streamly.FileSystem.FDIO (IOVec(..))
53import Streamly.FileSystem.FDIO (IOVec(..))
54#endif
54#endif
55−import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..), length)
55+import Streamly.Internal.Data.Array.Foreign.Types (Array(..), length)
56import Streamly.Internal.Data.Fold.Types (Fold(..))
56import Streamly.Internal.Data.Fold.Types (Fold(..))
57import Streamly.Internal.Data.Stream.Serial (SerialT)
57import Streamly.Internal.Data.Stream.Serial (SerialT)
58import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
58import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
59import Streamly.Internal.Data.SVar (adaptState)
59import Streamly.Internal.Data.SVar (adaptState)
60
60
61−import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
61+import qualified Streamly.Internal.Data.Array.Foreign as A
62−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
62+import qualified Streamly.Internal.Data.Array.Foreign.Types as A
63−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types as MA
63+import qualified Streamly.Internal.Data.Array.Foreign.Mut.Types as MA
64import qualified Streamly.Internal.Data.Array.Stream.Mut.Foreign as AS
64import qualified Streamly.Internal.Data.Array.Stream.Mut.Foreign as AS
65import qualified Streamly.Internal.Data.Fold.Types as FL
65import qualified Streamly.Internal.Data.Fold.Types as FL
66import qualified Streamly.Internal.Data.Stream.IsStream as S
66import qualified Streamly.Internal.Data.Stream.IsStream as S
src/Streamly/Internal/Network/Inet/TCP.hs+2−2
@@ -103,7 +103,7 @@ import Network.Socket
103 socket)
103 socket)
104import Prelude hiding (read)
104import Prelude hiding (read)
105
105
106−import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..), defaultChunkSize, writeNUnsafe)
106+import Streamly.Internal.Data.Array.Foreign.Types (Array(..), defaultChunkSize, writeNUnsafe)
107import Streamly.Internal.Data.Fold.Types (Fold(..))
107import Streamly.Internal.Data.Fold.Types (Fold(..))
108import Streamly.Internal.Data.SVar (fork)
108import Streamly.Internal.Data.SVar (fork)
109import Streamly.Internal.Data.Stream.Serial (SerialT)
109import Streamly.Internal.Data.Stream.Serial (SerialT)
@@ -117,7 +117,7 @@ import qualified Control.Monad.Catch as MC
117import qualified Network.Socket as Net
117import qualified Network.Socket as Net
118
118
119import qualified Streamly.Internal.Data.Unfold as UF
119import qualified Streamly.Internal.Data.Unfold as UF
120−import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
120+import qualified Streamly.Internal.Data.Array.Foreign as A
121import qualified Streamly.Internal.Memory.ArrayStream as AS
121import qualified Streamly.Internal.Memory.ArrayStream as AS
122import qualified Streamly.Internal.Data.Fold.Types as FL
122import qualified Streamly.Internal.Data.Fold.Types as FL
123import qualified Streamly.Prelude as S
123import qualified Streamly.Prelude as S
src/Streamly/Internal/Network/Socket.hs+8−8
@@ -90,8 +90,8 @@ import qualified Network.Socket as Net
90import Streamly.Prelude (MonadAsync)
90import Streamly.Prelude (MonadAsync)
91import Streamly.Internal.Data.Unfold.Types (Unfold(..))
91import Streamly.Internal.Data.Unfold.Types (Unfold(..))
92import Streamly.Internal.Memory.ArrayStream (lpackArraysChunksOf)
92import Streamly.Internal.Memory.ArrayStream (lpackArraysChunksOf)
93−import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..))
93+import Streamly.Internal.Data.Array.Foreign.Types (Array(..))
94−import Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types (mutableArray)
94+import Streamly.Internal.Data.Array.Foreign.Mut.Types (mutableArray)
95import Streamly.Internal.Data.Stream.Serial (SerialT)
95import Streamly.Internal.Data.Stream.Serial (SerialT)
96import Streamly.Internal.Data.Stream.StreamK.Type (IsStream, mkStream)
96import Streamly.Internal.Data.Stream.StreamK.Type (IsStream, mkStream)
97import Streamly.Data.Fold (Fold)
97import Streamly.Data.Fold (Fold)
@@ -100,10 +100,10 @@ import Streamly.Data.Fold (Fold)
100import qualified Streamly.Data.Fold as FL
100import qualified Streamly.Data.Fold as FL
101import qualified Streamly.Internal.Data.Fold.Types as FL
101import qualified Streamly.Internal.Data.Fold.Types as FL
102import qualified Streamly.Internal.Data.Unfold as UF
102import qualified Streamly.Internal.Data.Unfold as UF
103−import qualified Streamly.Internal.Data.Array.Storable.Foreign as IA
103+import qualified Streamly.Internal.Data.Array.Foreign as IA
104−import qualified Streamly.Data.Array.Storable.Foreign as A
104+import qualified Streamly.Data.Array.Foreign as A
105import qualified Streamly.Internal.Memory.ArrayStream as AS
105import qualified Streamly.Internal.Memory.ArrayStream as AS
106−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
106+import qualified Streamly.Internal.Data.Array.Foreign.Types as A
107import qualified Streamly.Prelude as S
107import qualified Streamly.Prelude as S
108import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
108import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
109
109
@@ -381,9 +381,9 @@ readChunksWithBufferOf = Unfold step return
381
381
382-- | Unfolds a socket into a stream of 'Word8' arrays. Requests to the socket
382-- | Unfolds a socket into a stream of 'Word8' arrays. Requests to the socket
383-- are performed using a buffer of size
383-- are performed using a buffer of size
384−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'. The
384+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'. The
385-- size of arrays in the resulting stream are therefore less than or equal to
385-- size of arrays in the resulting stream are therefore less than or equal to
386−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'.
386+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
387--
387--
388-- @since 0.7.0
388-- @since 0.7.0
389{-# INLINE readChunks #-}
389{-# INLINE readChunks #-}
@@ -430,7 +430,7 @@ readWithBufferOf = UF.concat readChunksWithBufferOf A.read
430
430
431-- | Unfolds a 'Socket' into a byte stream. IO requests to the socket are
431-- | Unfolds a 'Socket' into a byte stream. IO requests to the socket are
432-- performed in sizes of
432-- performed in sizes of
433−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'.
433+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'.
434--
434--
435-- @since 0.7.0
435-- @since 0.7.0
436{-# INLINE read #-}
436{-# INLINE read #-}
src/Streamly/Internal/Unicode/Array/Char.hs+2−2
@@ -20,11 +20,11 @@ where
20import Control.Monad.IO.Class (MonadIO)
20import Control.Monad.IO.Class (MonadIO)
21import Streamly.Prelude (MonadAsync)
21import Streamly.Prelude (MonadAsync)
22import Prelude hiding (String, lines, words, unlines, unwords)
22import Prelude hiding (String, lines, words, unlines, unwords)
23−import Streamly.Data.Array.Storable.Foreign (Array)
23+import Streamly.Data.Array.Foreign (Array)
24import Streamly.Internal.Data.Stream.IsStream (IsStream)
24import Streamly.Internal.Data.Stream.IsStream (IsStream)
25
25
26import qualified Streamly.Internal.Unicode.Stream as S
26import qualified Streamly.Internal.Unicode.Stream as S
27−import qualified Streamly.Data.Array.Storable.Foreign as A
27+import qualified Streamly.Data.Array.Foreign as A
28
28
29-- | Break a string up into a stream of strings at newline characters.
29-- | Break a string up into a stream of strings at newline characters.
30-- The resulting strings do not contain newlines.
30-- The resulting strings do not contain newlines.
src/Streamly/Internal/Unicode/Stream.hs+2−2
@@ -81,14 +81,14 @@ import GHC.IO.Encoding.Failure (isSurrogate)
81import GHC.Ptr (Ptr (..), plusPtr)
81import GHC.Ptr (Ptr (..), plusPtr)
82import System.IO.Unsafe (unsafePerformIO)
82import System.IO.Unsafe (unsafePerformIO)
83import Streamly.Data.Fold (Fold)
83import Streamly.Data.Fold (Fold)
84−import Streamly.Data.Array.Storable.Foreign (Array)
84+import Streamly.Data.Array.Foreign (Array)
85import Streamly.Internal.Data.Unfold (Unfold)
85import Streamly.Internal.Data.Unfold (Unfold)
86import Streamly.Internal.Data.SVar (adaptState)
86import Streamly.Internal.Data.SVar (adaptState)
87import Streamly.Internal.Data.Stream.IsStream (IsStream)
87import Streamly.Internal.Data.Stream.IsStream (IsStream)
88import Streamly.Internal.Data.Stream.StreamD (Stream(..), Step (..))
88import Streamly.Internal.Data.Stream.StreamD (Stream(..), Step (..))
89import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
89import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
90
90
91−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
91+import qualified Streamly.Internal.Data.Array.Foreign.Types as A
92import qualified Streamly.Internal.Data.Stream.IsStream as S
92import qualified Streamly.Internal.Data.Stream.IsStream as S
93import qualified Streamly.Internal.Data.Stream.StreamD as D
93import qualified Streamly.Internal.Data.Stream.StreamD as D
94
94
src/Streamly/Memory/Array.hs+3−3
@@ -32,10 +32,10 @@
32--
32--
33-- > import qualified Streamly.Array as A
33-- > import qualified Streamly.Array as A
34--
34--
35−-- For experimental APIs see "Streamly.Internal.Data.Array.Storable.Foreign".
35+-- For experimental APIs see "Streamly.Internal.Data.Array.Foreign".
36
36
37module Streamly.Memory.Array
37module Streamly.Memory.Array
38− {-# DEPRECATED "Use Streamly.Data.Array.Storable.Foreign instead" #-}
38+ {-# DEPRECATED "Use Streamly.Data.Array.Foreign instead" #-}
39 (
39 (
40 A.Array
40 A.Array
41
41
@@ -71,4 +71,4 @@ module Streamly.Memory.Array
71 )
71 )
72where
72where
73
73
74−import Streamly.Internal.Data.Array.Storable.Foreign as A
74+import Streamly.Internal.Data.Array.Foreign as A
src/Streamly/Memory/Ring.hs+1−1
@@ -41,7 +41,7 @@ import Prelude hiding (length, concat)
41
41
42import Control.Monad.IO.Class (MonadIO(..))
42import Control.Monad.IO.Class (MonadIO(..))
43
43
44−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
44+import qualified Streamly.Internal.Data.Array.Foreign.Types as A
45
45
46-- | A ring buffer is a mutable array of fixed size. Initially the array is
46-- | A ring buffer is a mutable array of fixed size. Initially the array is
47-- empty, with ringStart pointing at the start of allocated memory. We call the
47-- empty, with ringStart pointing at the start of allocated memory. We call the
src/Streamly/Network/Socket.hs+3−3
@@ -64,9 +64,9 @@
64-- = Programmer Notes
64-- = Programmer Notes
65--
65--
66-- Read IO requests to connected stream sockets are performed in chunks of
66-- Read IO requests to connected stream sockets are performed in chunks of
67−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'. Unless specified
67+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize'. Unless specified
68-- otherwise in the API, writes are collected into chunks of
68-- otherwise in the API, writes are collected into chunks of
69−-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize' before they are
69+-- 'Streamly.Internal.Data.Array.Foreign.Types.defaultChunkSize' before they are
70-- written to the socket. APIs are provided to control the chunking behavior.
70-- written to the socket. APIs are provided to control the chunking behavior.
71--
71--
72-- > import qualified Streamly.Network.Socket as SK
72-- > import qualified Streamly.Network.Socket as SK
@@ -89,7 +89,7 @@
89-- APIs for unconnected sockets need to explicitly specify the remote endpoint.
89-- APIs for unconnected sockets need to explicitly specify the remote endpoint.
90--
90--
91-- By design, connected socket IO APIs are similar to
91-- By design, connected socket IO APIs are similar to
92−-- "Streamly.Data.Array.Storable.Foreign" read write APIs. They are almost identical to the
92+-- "Streamly.Data.Array.Foreign" read write APIs. They are almost identical to the
93-- sequential streaming APIs in "Streamly.Internal.FileSystem.File".
93-- sequential streaming APIs in "Streamly.Internal.FileSystem.File".
94--
94--
95module Streamly.Network.Socket
95module Streamly.Network.Socket
src/Streamly/Unicode/Stream.hs+3−3
@@ -12,11 +12,11 @@
12-- A 'Char' stream is the canonical representation to process Unicode strings.
12-- A 'Char' stream is the canonical representation to process Unicode strings.
13-- It can be processed efficiently using regular stream processing operations.
13-- It can be processed efficiently using regular stream processing operations.
14-- A byte stream of Unicode text read from an IO device or from an
14-- A byte stream of Unicode text read from an IO device or from an
15−-- 'Streamly.Data.Array.Storable.Foreign.Array' in memory can be decoded into a 'Char' stream
15+-- 'Streamly.Data.Array.Foreign.Array' in memory can be decoded into a 'Char' stream
16-- using the decoding routines in this module. A 'String' (@[Char]@) can be
16-- using the decoding routines in this module. A 'String' (@[Char]@) can be
17-- converted into a 'Char' stream using 'Streamly.Prelude.fromList'. An @Array
17-- converted into a 'Char' stream using 'Streamly.Prelude.fromList'. An @Array
18-- Char@ can be 'Streamly.Prelude.unfold'ed into a stream using the array
18-- Char@ can be 'Streamly.Prelude.unfold'ed into a stream using the array
19−-- 'Streamly.Data.Array.Storable.Foreign.read' unfold.
19+-- 'Streamly.Data.Array.Foreign.read' unfold.
20--
20--
21-- = Storing Unicode Strings
21-- = Storing Unicode Strings
22--
22--
@@ -30,7 +30,7 @@
30-- than pinned arrays for short and short lived strings.
30-- than pinned arrays for short and short lived strings.
31--
31--
32-- For longer or long lived streams you can 'Streamly.Prelude.fold' the 'Char'
32-- For longer or long lived streams you can 'Streamly.Prelude.fold' the 'Char'
33−-- stream as @Array Char@ using the array 'Streamly.Data.Array.Storable.Foreign.write' fold.
33+-- stream as @Array Char@ using the array 'Streamly.Data.Array.Foreign.write' fold.
34-- The 'Array' type provides a more compact representation and pinned memory
34-- The 'Array' type provides a more compact representation and pinned memory
35-- reducing GC overhead. If space efficiency is a concern you can use
35-- reducing GC overhead. If space efficiency is a concern you can use
36-- 'encodeUtf8'' on the 'Char' stream before writing it to an 'Array' providing
36-- 'encodeUtf8'' on the 'Char' stream before writing it to an 'Array' providing
streamly.cabal+5−5
@@ -166,7 +166,7 @@ extra-source-files:
166 test/Streamly/Test/Data/*.hs
166 test/Streamly/Test/Data/*.hs
167 test/Streamly/Test/Data/Array/Prim.hs
167 test/Streamly/Test/Data/Array/Prim.hs
168 test/Streamly/Test/Data/Array/Prim/Pinned.hs
168 test/Streamly/Test/Data/Array/Prim/Pinned.hs
169− test/Streamly/Test/Data/Array/Storable/Foreign.hs
169+ test/Streamly/Test/Data/Array/Foreign.hs
170 test/Streamly/Test/Data/Parser/ParserD.hs
170 test/Streamly/Test/Data/Parser/ParserD.hs
171 test/Streamly/Test/FileSystem/Event.hs
171 test/Streamly/Test/FileSystem/Event.hs
172 test/Streamly/Test/FileSystem/Handle.hs
172 test/Streamly/Test/FileSystem/Handle.hs
@@ -388,7 +388,7 @@ library
388 Streamly.Prelude
388 Streamly.Prelude
389 , Streamly.Data.Unfold
389 , Streamly.Data.Unfold
390 , Streamly.Data.Fold
390 , Streamly.Data.Fold
391− , Streamly.Data.Array.Storable.Foreign
391+ , Streamly.Data.Array.Foreign
392
392
393 -- Text Processing
393 -- Text Processing
394 , Streamly.Unicode.Stream
394 , Streamly.Unicode.Stream
@@ -444,8 +444,8 @@ library
444
444
445 -- streamly-core-array
445 -- streamly-core-array
446 -- May depend on streamly-core-stream
446 -- May depend on streamly-core-stream
447− , Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types
447+ , Streamly.Internal.Data.Array.Foreign.Mut.Types
448− , Streamly.Internal.Data.Array.Storable.Foreign.Types
448+ , Streamly.Internal.Data.Array.Foreign.Types
449 , Streamly.Internal.Data.Array.Prim.Mut.Types
449 , Streamly.Internal.Data.Array.Prim.Mut.Types
450 , Streamly.Internal.Data.Array.Prim.Types
450 , Streamly.Internal.Data.Array.Prim.Types
451 , Streamly.Internal.Data.Array.Prim.Pinned.Mut.Types
451 , Streamly.Internal.Data.Array.Prim.Pinned.Mut.Types
@@ -498,7 +498,7 @@ library
498 -- streamly-arrays
498 -- streamly-arrays
499 -- May depend on streamly-core
499 -- May depend on streamly-core
500 , Streamly.Internal.Data.Array
500 , Streamly.Internal.Data.Array
501− , Streamly.Internal.Data.Array.Storable.Foreign
501+ , Streamly.Internal.Data.Array.Foreign
502 , Streamly.Internal.Data.Array.Prim
502 , Streamly.Internal.Data.Array.Prim
503 , Streamly.Internal.Data.Array.Prim.Pinned
503 , Streamly.Internal.Data.Array.Prim.Pinned
504 , Streamly.Internal.Data.SmallArray
504 , Streamly.Internal.Data.SmallArray
test/Streamly/Test/Common/Array.hs+2−2
@@ -28,8 +28,8 @@ type Array = A.SmallArray
28#elif defined(TEST_ARRAY)
28#elif defined(TEST_ARRAY)
29import Data.Word(Word8)
29import Data.Word(Word8)
30
30
31−import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
31+import qualified Streamly.Internal.Data.Array.Foreign as A
32−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
32+import qualified Streamly.Internal.Data.Array.Foreign.Types as A
33import qualified Streamly.Internal.Data.Stream.IsStream as IP
33import qualified Streamly.Internal.Data.Stream.IsStream as IP
34import qualified Streamly.Internal.Memory.ArrayStream as AS
34import qualified Streamly.Internal.Memory.ArrayStream as AS
35type Array = A.Array
35type Array = A.Array
test/Streamly/Test/Data/Array/Storable/Foreign.hs → test/Streamly/Test/Data/Array/Foreign.hsrenamed+2−2
@@ -1,12 +1,12 @@
1-- |
1-- |
2−-- Module : Streamly.Test.Data.Array.Storable.Foreign
2+-- Module : Streamly.Test.Data.Array.Foreign
3-- Copyright : (c) 2019 Composewell technologies
3-- Copyright : (c) 2019 Composewell technologies
4-- License : BSD-3-Clause
4-- License : BSD-3-Clause
5-- Maintainer : streamly@composewell.com
5-- Maintainer : streamly@composewell.com
6-- Stability : experimental
6-- Stability : experimental
7-- Portability : GHC
7-- Portability : GHC
8
8
9−module Streamly.Test.Data.Array.Storable.Foreign (main) where
9+module Streamly.Test.Data.Array.Foreign (main) where
10
10
11#define TEST_ARRAY
11#define TEST_ARRAY
12#include "Streamly/Test/Common/Array.hs"
12#include "Streamly/Test/Common/Array.hs"
test/Streamly/Test/Data/Parser.hs+1−1
@@ -14,7 +14,7 @@ import Prelude hiding (sequence)
14
14
15import qualified Data.List as List
15import qualified Data.List as List
16import qualified Prelude
16import qualified Prelude
17−import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
17+import qualified Streamly.Internal.Data.Array.Foreign as A
18import qualified Streamly.Internal.Data.Fold as FL
18import qualified Streamly.Internal.Data.Fold as FL
19import qualified Streamly.Internal.Data.Parser as P
19import qualified Streamly.Internal.Data.Parser as P
20import qualified Streamly.Internal.Data.Stream.IsStream as S
20import qualified Streamly.Internal.Data.Stream.IsStream as S
test/Streamly/Test/Data/Parser/ParserD.hs+1−1
@@ -12,7 +12,7 @@ import Test.QuickCheck.Monadic (monadicIO, assert, run)
12
12
13import qualified Data.List as List
13import qualified Data.List as List
14import qualified Prelude
14import qualified Prelude
15−import qualified Streamly.Internal.Data.Array.Storable.Foreign as A
15+import qualified Streamly.Internal.Data.Array.Foreign as A
16import qualified Streamly.Internal.Data.Fold as FL
16import qualified Streamly.Internal.Data.Fold as FL
17import qualified Streamly.Internal.Data.Parser.ParserD as P
17import qualified Streamly.Internal.Data.Parser.ParserD as P
18import qualified Streamly.Internal.Data.Stream.IsStream as S
18import qualified Streamly.Internal.Data.Stream.IsStream as S
test/Streamly/Test/FileSystem/Event.hs+2−2
@@ -29,12 +29,12 @@ import System.IO.Temp (withSystemTempDirectory)
29#if !defined(CABAL_OS_WINDOWS)
29#if !defined(CABAL_OS_WINDOWS)
30import System.IO.Unsafe (unsafePerformIO)
30import System.IO.Unsafe (unsafePerformIO)
31#endif
31#endif
32−import Streamly.Internal.Data.Array.Storable.Foreign (Array)
32+import Streamly.Internal.Data.Array.Foreign (Array)
33
33
34import qualified Data.List.NonEmpty as NonEmpty
34import qualified Data.List.NonEmpty as NonEmpty
35import qualified Data.Set as Set
35import qualified Data.Set as Set
36import qualified Streamly.Unicode.Stream as Unicode
36import qualified Streamly.Unicode.Stream as Unicode
37−import qualified Streamly.Internal.Data.Array.Storable.Foreign as Array
37+import qualified Streamly.Internal.Data.Array.Foreign as Array
38import qualified Streamly.Internal.Data.Fold as FL
38import qualified Streamly.Internal.Data.Fold as FL
39import qualified Streamly.Internal.Data.Parser as PR
39import qualified Streamly.Internal.Data.Parser as PR
40import qualified Streamly.Internal.Data.Stream.IsStream as S
40import qualified Streamly.Internal.Data.Stream.IsStream as S
test/Streamly/Test/FileSystem/Handle.hs+1−1
@@ -29,7 +29,7 @@ import Test.QuickCheck.Monadic (monadicIO, assert, run)
29import qualified Streamly.Data.Fold as Fold
29import qualified Streamly.Data.Fold as Fold
30import qualified Streamly.FileSystem.Handle as Handle
30import qualified Streamly.FileSystem.Handle as Handle
31import qualified Streamly.Internal.Data.Stream.IsStream as Stream
31import qualified Streamly.Internal.Data.Stream.IsStream as Stream
32−import qualified Streamly.Internal.Data.Array.Storable.Foreign as Array
32+import qualified Streamly.Internal.Data.Array.Foreign as Array
33import qualified Streamly.Internal.Unicode.Stream as Unicode
33import qualified Streamly.Internal.Unicode.Stream as Unicode
34
34
35import Test.Hspec as H
35import Test.Hspec as H
test/Streamly/Test/Network/Inet/TCP.hs+1−1
@@ -19,7 +19,7 @@ import Streamly.Prelude (SerialT)
19import Test.QuickCheck (Property)
19import Test.QuickCheck (Property)
20import Test.QuickCheck.Monadic (monadicIO, assert, run)
20import Test.QuickCheck.Monadic (monadicIO, assert, run)
21
21
22−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as Array
22+import qualified Streamly.Internal.Data.Array.Foreign.Types as Array
23import qualified Streamly.Internal.Data.Unfold as Unfold
23import qualified Streamly.Internal.Data.Unfold as Unfold
24import qualified Streamly.Internal.Network.Inet.TCP as TCP
24import qualified Streamly.Internal.Network.Inet.TCP as TCP
25import qualified Streamly.Internal.Network.Socket as Socket
25import qualified Streamly.Internal.Network.Socket as Socket
test/Streamly/Test/Network/Socket.hs+1−1
@@ -19,7 +19,7 @@ import Streamly.Prelude (SerialT)
19import Test.QuickCheck (Property)
19import Test.QuickCheck (Property)
20import Test.QuickCheck.Monadic (monadicIO, assert, run)
20import Test.QuickCheck.Monadic (monadicIO, assert, run)
21
21
22−import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as Array
22+import qualified Streamly.Internal.Data.Array.Foreign.Types as Array
23import qualified Streamly.Internal.Network.Inet.TCP as TCP
23import qualified Streamly.Internal.Network.Inet.TCP as TCP
24import qualified Streamly.Internal.Network.Socket as Socket
24import qualified Streamly.Internal.Network.Socket as Socket
25import qualified Streamly.Internal.Unicode.Stream as Unicode
25import qualified Streamly.Internal.Unicode.Stream as Unicode
test/Streamly/Test/Prelude/Serial.hs+1−1
@@ -46,7 +46,7 @@ import qualified Streamly.Prelude as S
46import qualified Streamly.Data.Fold as FL
46import qualified Streamly.Data.Fold as FL
47import qualified Streamly.Internal.Data.Unfold as UF
47import qualified Streamly.Internal.Data.Unfold as UF
48import qualified Streamly.Internal.Data.Stream.IsStream as IS
48import qualified Streamly.Internal.Data.Stream.IsStream as IS
49−import qualified Streamly.Data.Array.Storable.Foreign as A
49+import qualified Streamly.Data.Array.Foreign as A
50
50
51import Streamly.Internal.Data.Time.Units
51import Streamly.Internal.Data.Time.Units
52 (AbsTime, NanoSecond64(..), toRelTime64, diffAbsTime64)
52 (AbsTime, NanoSecond64(..), toRelTime64, diffAbsTime64)
test/Streamly/Test/Unicode/Stream.hs+1−1
@@ -16,7 +16,7 @@ import Test.QuickCheck
16 )
16 )
17import Test.QuickCheck.Monadic (run, monadicIO, assert)
17import Test.QuickCheck.Monadic (run, monadicIO, assert)
18
18
19−import qualified Streamly.Data.Array.Storable.Foreign as A
19+import qualified Streamly.Data.Array.Foreign as A
20import qualified Streamly.Internal.Memory.ArrayStream as AS
20import qualified Streamly.Internal.Memory.ArrayStream as AS
21import qualified Streamly.Prelude as S
21import qualified Streamly.Prelude as S
22import qualified Streamly.Unicode.Stream as SS
22import qualified Streamly.Unicode.Stream as SS
test/streamly-tests.cabal+3−3
@@ -207,11 +207,11 @@ test-suite Data.Array.Prim.Pinned
207 main-is: Streamly/Test/Data/Array/Prim/Pinned.hs
207 main-is: Streamly/Test/Data/Array/Prim/Pinned.hs
208 ghc-options: -main-is Streamly.Test.Data.Array.Prim.Pinned.main
208 ghc-options: -main-is Streamly.Test.Data.Array.Prim.Pinned.main
209
209
210−test-suite Data.Array.Storable.Foreign
210+test-suite Data.Array.Foreign
211 import: test-options
211 import: test-options
212 type: exitcode-stdio-1.0
212 type: exitcode-stdio-1.0
213− main-is: Streamly/Test/Data/Array/Storable/Foreign.hs
213+ main-is: Streamly/Test/Data/Array/Foreign.hs
214− ghc-options: -main-is Streamly.Test.Data.Array.Storable.Foreign.main
214+ ghc-options: -main-is Streamly.Test.Data.Array.Foreign.main
215
215
216test-suite Data.Fold
216test-suite Data.Fold
217 import: test-options
217 import: test-options