on master help sign in
Refactor modules Mem.* ~> Memory.* and update references.
bda6a64Pranay Sashank
Changelog.md+2−2
@@ -81,9 +81,9 @@ example, concat streams concurrently using this.
81* Add the following new features/modules:
81* Add the following new features/modules:
82 * _Unicode Strings_: `Streamly.String` module provides encoding/decoding of
82 * _Unicode Strings_: `Streamly.String` module provides encoding/decoding of
83 character streams and other character stream operations.
83 character streams and other character stream operations.
84− * _Arrays_: `Streamly.Mem.Array` module provides arrays for efficient
84+ * _Arrays_: `Streamly.Memory.Array` module provides arrays for efficient
85 in-memory buffering and efficient interfacing with IO.
85 in-memory buffering and efficient interfacing with IO.
86− * `Streamly.Mem.Array.Stream` module provide combinators to work on streams
86+ * `Streamly.Memory.Array.Stream` module provide combinators to work on streams
87 of arrays.
87 of arrays.
88
88
89* Add the following to `Streamly.Prelude`:
89* Add the following to `Streamly.Prelude`:
README.md+3−3
@@ -361,7 +361,7 @@ documentation.
361
361
362## Arrays
362## Arrays
363
363
364−The `Streamly.Mem.Array` module provides mutable arrays. Arrays are the
364+The `Streamly.Memory.Array` module provides mutable arrays. Arrays are the
365computing duals of streams. Streams are good at sequential access, immutable
365computing duals of streams. Streams are good at sequential access, immutable
366transformations of in-transit data whereas arrays are good at random access,
366transformations of in-transit data whereas arrays are good at random access,
367in-place transformations of buffered data. Unlike streams which are potentially
367in-place transformations of buffered data. Unlike streams which are potentially
@@ -407,8 +407,8 @@ module Main where
407
407
408import qualified Streamly.Prelude as S
408import qualified Streamly.Prelude as S
409import qualified Streamly.Fold as FL
409import qualified Streamly.Fold as FL
410−import qualified Streamly.Mem.Array as A
410+import qualified Streamly.Memory.Array as A
411−import qualified Streamly.Mem.ArrayStream as AS
411+import qualified Streamly.Memory.ArrayStream as AS
412import qualified Streamly.FileSystem.Handle as FH
412import qualified Streamly.FileSystem.Handle as FH
413import qualified System.IO as FH
413import qualified System.IO as FH
414
414
benchmark/Array.hs+1−1
@@ -13,7 +13,7 @@ import System.Random (randomRIO)
13import qualified GHC.Exts as GHC
13import qualified GHC.Exts as GHC
14
14
15import qualified ArrayOps as Ops
15import qualified ArrayOps as Ops
16−import qualified Streamly.Mem.Array as A
16+import qualified Streamly.Memory.Array as A
17import qualified Streamly.Prelude as S
17import qualified Streamly.Prelude as S
18
18
19import Gauge
19import Gauge
benchmark/ArrayOps.hs+1−1
@@ -26,7 +26,7 @@ import qualified GHC.Exts as GHC
26-- import GHC.Generics (Generic)
26-- import GHC.Generics (Generic)
27
27
28import qualified Streamly as S hiding (foldMapWith, runStream)
28import qualified Streamly as S hiding (foldMapWith, runStream)
29−import qualified Streamly.Mem.Array as A
29+import qualified Streamly.Memory.Array as A
30import qualified Streamly.Prelude as S
30import qualified Streamly.Prelude as S
31
31
32value, maxValue :: Int
32value, maxValue :: Int
benchmark/FileIO.hs+2−2
@@ -16,8 +16,8 @@ import Data.IORef
16import Gauge
16import Gauge
17
17
18import qualified Streamly.FileSystem.Handle as FH
18import qualified Streamly.FileSystem.Handle as FH
19−import qualified Streamly.Mem.Array as A
19+import qualified Streamly.Memory.Array as A
20−import qualified Streamly.Mem.ArrayStream as AS
20+import qualified Streamly.Memory.ArrayStream as AS
21import qualified Streamly.Prelude as S
21import qualified Streamly.Prelude as S
22import qualified Streamly.Fold as FL
22import qualified Streamly.Fold as FL
23import qualified Streamly.String as SS
23import qualified Streamly.String as SS
benchmark/Linear.hs+1−1
@@ -21,7 +21,7 @@ import qualified LinearOps as Ops
21import Streamly
21import Streamly
22import qualified Streamly.Fold as FL
22import qualified Streamly.Fold as FL
23--import qualified Streamly.Pipe as Pipe
23--import qualified Streamly.Pipe as Pipe
24−import qualified Streamly.Mem.Array as A
24+import qualified Streamly.Memory.Array as A
25import qualified Streamly.Prelude as S
25import qualified Streamly.Prelude as S
26-- import qualified Streamly.Sink as Sink
26-- import qualified Streamly.Sink as Sink
27import Gauge
27import Gauge
benchmark/NanoBenchmarks.hs+1−1
@@ -9,7 +9,7 @@
9import Streamly (SerialT)
9import Streamly (SerialT)
10import Streamly.SVar (MonadAsync)
10import Streamly.SVar (MonadAsync)
11
11
12−import qualified Streamly.Mem.Array as A
12+import qualified Streamly.Memory.Array as A
13import qualified Streamly.FileSystem.Handle as FH
13import qualified Streamly.FileSystem.Handle as FH
14import qualified Streamly.Fold as FL
14import qualified Streamly.Fold as FL
15import qualified Streamly.Prelude as S
15import qualified Streamly.Prelude as S
design/inlining.md+1−1
@@ -62,7 +62,7 @@ concatMap1 src = runStream $ S.concatMap (S.replicate 3) src
62 as `INLINE` or `INLINE_EARLY`, instead they should all be marked as
62 as `INLINE` or `INLINE_EARLY`, instead they should all be marked as
63 `INLINE_NORMAL` because higher order funcitons like `concatMap`/`map`/`mapM`
63 `INLINE_NORMAL` because higher order funcitons like `concatMap`/`map`/`mapM`
64 etc are marked as `INLINE_NORMAL`. `StreamD` functions in other modules like
64 etc are marked as `INLINE_NORMAL`. `StreamD` functions in other modules like
65− `Streamly.Mem.Array` should also follow the same rules.
65+ `Streamly.Memory.Array` should also follow the same rules.
66
66
67* The inlining of the `step` function (in case of `StreamD`) is annotated as
67* The inlining of the `step` function (in case of `StreamD`) is annotated as
68 `INLINE_LATE` so that those are inlined after fusion rules have been applied.
68 `INLINE_LATE` so that those are inlined after fusion rules have been applied.
examples/FileIOExamples.hs+1−1
@@ -1,6 +1,6 @@
1import qualified Streamly.Prelude as S
1import qualified Streamly.Prelude as S
2import qualified Streamly.Fold as FL
2import qualified Streamly.Fold as FL
3−import qualified Streamly.Mem.Array as A
3+import qualified Streamly.Memory.Array as A
4import qualified Streamly.FileSystem.File as File
4import qualified Streamly.FileSystem.File as File
5
5
6import Data.Char (ord)
6import Data.Char (ord)
examples/FileSinkServer.hs+1−1
@@ -10,7 +10,7 @@ import System.Environment (getArgs)
10import Streamly
10import Streamly
11import Streamly.String
11import Streamly.String
12import qualified Streamly.FileSystem.Handle as FH
12import qualified Streamly.FileSystem.Handle as FH
13−import qualified Streamly.Mem.Array as A
13+import qualified Streamly.Memory.Array as A
14import qualified Streamly.Network.Socket as NS
14import qualified Streamly.Network.Socket as NS
15import qualified Streamly.Network.Server as NS
15import qualified Streamly.Network.Server as NS
16import qualified Streamly.Prelude as S
16import qualified Streamly.Prelude as S
examples/HandleIO.hs+2−2
@@ -1,7 +1,7 @@
1import qualified Streamly.Prelude as S
1import qualified Streamly.Prelude as S
2import qualified Streamly.Fold as FL
2import qualified Streamly.Fold as FL
3−-- import qualified Streamly.Mem.Array as A
3+-- import qualified Streamly.Memory.Array as A
4−import qualified Streamly.Mem.ArrayStream as AS
4+import qualified Streamly.Memory.ArrayStream as AS
5import qualified Streamly.FileSystem.Handle as FH
5import qualified Streamly.FileSystem.Handle as FH
6import qualified System.IO as FH
6import qualified System.IO as FH
7-- import qualified Streamly.FileSystem.FD as FH
7-- import qualified Streamly.FileSystem.FD as FH
src/Streamly.hs+2−2
@@ -216,7 +216,7 @@ import qualified Streamly.Streams.StreamK as K
216-- > S.length $ S.splitOnSuffix FL.drain 10 $ FH.read fh
216-- > S.length $ S.splitOnSuffix FL.drain 10 $ FH.read fh
217--
217--
218-- The following example folds the lines to arrays of 'Word8' using the
218-- The following example folds the lines to arrays of 'Word8' using the
219−-- 'Streamly.Mem.Array.writeF' fold and then wraps the lines in square
219+-- 'Streamly.Memory.Array.writeF' fold and then wraps the lines in square
220-- brackets before writing them to standard output using
220-- brackets before writing them to standard output using
221-- 'Streamly.FileSystem.Handle.write':
221-- 'Streamly.FileSystem.Handle.write':
222--
222--
@@ -267,7 +267,7 @@ import qualified Streamly.Streams.StreamK as K
267
267
268-- $arrays
268-- $arrays
269--
269--
270−-- Streamly arrays (See "Streamly.Mem.Array") complement streams to provide an
270+-- Streamly arrays (See "Streamly.Memory.Array") complement streams to provide an
271-- efficient computing paradigm. Streams are suitable for immutable
271-- efficient computing paradigm. Streams are suitable for immutable
272-- transformations of /potentially infinite/ data using /sequential access/ and
272-- transformations of /potentially infinite/ data using /sequential access/ and
273-- pipelined transformations whereas arrays are suitable for in-place
273-- pipelined transformations whereas arrays are suitable for in-place
src/Streamly/FileSystem/FD.hs+6−6
@@ -31,7 +31,7 @@
31--
31--
32-- Reading and writing APIs are divided into two categories, sequential
32-- Reading and writing APIs are divided into two categories, sequential
33-- streaming APIs and random or seekable access APIs. File IO APIs are quite
33-- streaming APIs and random or seekable access APIs. File IO APIs are quite
34−-- similar to "Streamly.Mem.Array" read write APIs. In that regard, arrays can
34+-- similar to "Streamly.Memory.Array" read write APIs. In that regard, arrays can
35-- be considered as in-memory files or files can be considered as on-disk
35-- be considered as in-memory files or files can be considered as on-disk
36-- arrays.
36-- arrays.
37--
37--
@@ -136,13 +136,13 @@ import Prelude hiding (read)
136import qualified GHC.IO.FD as FD
136import qualified GHC.IO.FD as FD
137import qualified GHC.IO.Device as RawIO
137import qualified GHC.IO.Device as RawIO
138
138
139−import Streamly.Mem.Array.Types (Array(..))
139+import Streamly.Memory.Array.Types (Array(..))
140import Streamly.Streams.Serial (SerialT)
140import Streamly.Streams.Serial (SerialT)
141import Streamly.Streams.StreamK.Type (IsStream, mkStream)
141import Streamly.Streams.StreamK.Type (IsStream, mkStream)
142−import Streamly.Mem.Array.Types (byteLength, defaultChunkSize)
142+import Streamly.Memory.Array.Types (byteLength, defaultChunkSize)
143
143
144#if !defined(mingw32_HOST_OS)
144#if !defined(mingw32_HOST_OS)
145−import Streamly.Mem.Array.Types (groupIOVecsOf)
145+import Streamly.Memory.Array.Types (groupIOVecsOf)
146import Streamly.Streams.StreamD (toStreamD)
146import Streamly.Streams.StreamD (toStreamD)
147import Streamly.Streams.StreamD.Type (fromStreamD)
147import Streamly.Streams.StreamD.Type (fromStreamD)
148import qualified Streamly.FileSystem.FDIO as RawIO hiding (write)
148import qualified Streamly.FileSystem.FDIO as RawIO hiding (write)
@@ -150,8 +150,8 @@ import qualified Streamly.FileSystem.FDIO as RawIO hiding (write)
150-- import Streamly.Fold (Fold)
150-- import Streamly.Fold (Fold)
151-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
151-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
152
152
153−import qualified Streamly.Mem.Array as A
153+import qualified Streamly.Memory.Array as A
154−import qualified Streamly.Mem.ArrayStream as AS
154+import qualified Streamly.Memory.ArrayStream as AS
155import qualified Streamly.Prelude as S
155import qualified Streamly.Prelude as S
156import qualified Streamly.Streams.StreamD.Type as D
156import qualified Streamly.Streams.StreamD.Type as D
157
157
src/Streamly/FileSystem/File.hs+3−3
@@ -115,7 +115,7 @@ import Prelude hiding (read)
115
115
116import qualified System.IO as SIO
116import qualified System.IO as SIO
117
117
118−import Streamly.Mem.Array.Types (Array(..))
118+import Streamly.Memory.Array.Types (Array(..))
119import Streamly.Streams.Serial (SerialT)
119import Streamly.Streams.Serial (SerialT)
120import Streamly.Streams.StreamK.Type (IsStream)
120import Streamly.Streams.StreamK.Type (IsStream)
121import Streamly.SVar (MonadAsync)
121import Streamly.SVar (MonadAsync)
@@ -123,8 +123,8 @@ import Streamly.SVar (MonadAsync)
123-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
123-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
124
124
125import qualified Streamly.FileSystem.Handle as FH
125import qualified Streamly.FileSystem.Handle as FH
126−import qualified Streamly.Mem.ArrayStream as AS
126+import qualified Streamly.Memory.ArrayStream as AS
127−import qualified Streamly.Mem.Array.Types as A hiding (flattenArrays)
127+import qualified Streamly.Memory.Array.Types as A hiding (flattenArrays)
128import qualified Streamly.Prelude as S
128import qualified Streamly.Prelude as S
129
129
130-------------------------------------------------------------------------------
130-------------------------------------------------------------------------------
src/Streamly/FileSystem/Handle.hs+5−5
@@ -16,7 +16,7 @@
16-- Portability : GHC
16-- Portability : GHC
17--
17--
18-- Read and write streams and arrays to and from file handles. File handle IO
18-- Read and write streams and arrays to and from file handles. File handle IO
19−-- APIs are quite similar to "Streamly.Mem.Array" read write APIs. In that
19+-- APIs are quite similar to "Streamly.Memory.Array" read write APIs. In that
20-- regard, arrays can be considered as in-memory files or files can be
20-- regard, arrays can be considered as in-memory files or files can be
21-- considered as on-disk arrays.
21-- considered as on-disk arrays.
22--
22--
@@ -119,15 +119,15 @@ import GHC.ForeignPtr (mallocPlainForeignPtrBytes)
119import System.IO (Handle, hGetBufSome, hPutBuf)
119import System.IO (Handle, hGetBufSome, hPutBuf)
120import Prelude hiding (read)
120import Prelude hiding (read)
121
121
122−import Streamly.Mem.Array.Types (Array(..))
122+import Streamly.Memory.Array.Types (Array(..))
123import Streamly.Streams.Serial (SerialT)
123import Streamly.Streams.Serial (SerialT)
124import Streamly.Streams.StreamK.Type (IsStream, mkStream)
124import Streamly.Streams.StreamK.Type (IsStream, mkStream)
125−import Streamly.Mem.Array.Types (defaultChunkSize, shrinkToFit)
125+import Streamly.Memory.Array.Types (defaultChunkSize, shrinkToFit)
126-- import Streamly.Fold (Fold)
126-- import Streamly.Fold (Fold)
127-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
127-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
128
128
129−import qualified Streamly.Mem.Array as A
129+import qualified Streamly.Memory.Array as A
130−import qualified Streamly.Mem.ArrayStream as AS
130+import qualified Streamly.Memory.ArrayStream as AS
131import qualified Streamly.Prelude as S
131import qualified Streamly.Prelude as S
132import qualified Streamly.Streams.StreamD.Type as D
132import qualified Streamly.Streams.StreamD.Type as D
133
133
src/Streamly/Mem/Array.hs → src/Streamly/Memory/Array.hsrenamed+5−5
@@ -8,7 +8,7 @@
8#include "inline.hs"
8#include "inline.hs"
9
9
10-- |
10-- |
11−-- Module : Streamly.Mem.Array
11+-- Module : Streamly.Memory.Array
12-- Copyright : (c) 2019 Harendra Kumar
12-- Copyright : (c) 2019 Harendra Kumar
13--
13--
14-- License : BSD3
14-- License : BSD3
@@ -48,7 +48,7 @@
48-- less efficient compared to folding via streams. 'Semigroup' and 'Monoid'
48-- less efficient compared to folding via streams. 'Semigroup' and 'Monoid'
49-- instances are deliberately not provided to avoid misuse; concatenating
49-- instances are deliberately not provided to avoid misuse; concatenating
50-- arrays using binary operations can be highly inefficient. Instead, use
50-- arrays using binary operations can be highly inefficient. Instead, use
51−-- 'Streamly.Mem.Array.Stream.toArray' to concatenate N arrays at once.
51+-- 'Streamly.Memory.Array.Stream.toArray' to concatenate N arrays at once.
52--
52--
53-- Each array is one pointer visible to the GC. Too many small arrays (e.g.
53-- Each array is one pointer visible to the GC. Too many small arrays (e.g.
54-- single byte) are only as good as holding those elements in a Haskell list.
54-- single byte) are only as good as holding those elements in a Haskell list.
@@ -59,7 +59,7 @@
59-- arbitrarily large amounts of memory but still using small chunks of
59-- arbitrarily large amounts of memory but still using small chunks of
60-- contiguous memory.
60-- contiguous memory.
61
61
62−module Streamly.Mem.Array
62+module Streamly.Memory.Array
63 (
63 (
64 Array
64 Array
65
65
@@ -130,12 +130,12 @@ import Foreign.Ptr (minusPtr, plusPtr)
130import Foreign.Storable (Storable(..))
130import Foreign.Storable (Storable(..))
131import Prelude hiding (length, null, last, map, (!!), read)
131import Prelude hiding (length, null, last, map, (!!), read)
132
132
133−import Streamly.Mem.Array.Types (Array(..), length)
133+import Streamly.Memory.Array.Types (Array(..), length)
134import Streamly.Streams.Serial (SerialT)
134import Streamly.Streams.Serial (SerialT)
135import Streamly.Streams.StreamK.Type (IsStream)
135import Streamly.Streams.StreamK.Type (IsStream)
136import Streamly.Fold.Types (Fold(..))
136import Streamly.Fold.Types (Fold(..))
137
137
138−import qualified Streamly.Mem.Array.Types as A
138+import qualified Streamly.Memory.Array.Types as A
139import qualified Streamly.Streams.Prelude as P
139import qualified Streamly.Streams.Prelude as P
140import qualified Streamly.Streams.Serial as Serial
140import qualified Streamly.Streams.Serial as Serial
141import qualified Streamly.Streams.StreamD as D
141import qualified Streamly.Streams.StreamD as D
src/Streamly/Mem/Array/Types.hs → src/Streamly/Memory/Array/Types.hsrenamed+6−6
@@ -10,7 +10,7 @@
10#include "inline.hs"
10#include "inline.hs"
11
11
12-- |
12-- |
13−-- Module : Streamly.Mem.Array.Types
13+-- Module : Streamly.Memory.Array.Types
14-- Copyright : (c) 2019 Composewell Technologies
14-- Copyright : (c) 2019 Composewell Technologies
15--
15--
16-- License : BSD3
16-- License : BSD3
@@ -18,7 +18,7 @@
18-- Stability : experimental
18-- Stability : experimental
19-- Portability : GHC
19-- Portability : GHC
20--
20--
21−module Streamly.Mem.Array.Types
21+module Streamly.Memory.Array.Types
22 (
22 (
23 Array (..)
23 Array (..)
24
24
@@ -526,7 +526,7 @@ fromStreamDArraysOf n (D.Stream step state) =
526 step' _ (GroupStart st) = do
526 step' _ (GroupStart st) = do
527 when (n <= 0) $
527 when (n <= 0) $
528 -- XXX we can pass the module string from the higher level API
528 -- XXX we can pass the module string from the higher level API
529− error $ "Streamly.Mem.Array.Types.fromStreamDArraysOf: the size of "
529+ error $ "Streamly.Memory.Array.Types.fromStreamDArraysOf: the size of "
530 ++ "arrays [" ++ show n ++ "] must be a natural number"
530 ++ "arrays [" ++ show n ++ "] must be a natural number"
531 Array start end bound <- liftIO $ newArray n
531 Array start end bound <- liftIO $ newArray n
532 return $ D.Skip (GroupBuffer st start end bound)
532 return $ D.Skip (GroupBuffer st start end bound)
@@ -902,7 +902,7 @@ packArraysChunksOf n (D.Stream step state) =
902 step' gst (SpliceInitial st) = do
902 step' gst (SpliceInitial st) = do
903 when (n <= 0) $
903 when (n <= 0) $
904 -- XXX we can pass the module string from the higher level API
904 -- XXX we can pass the module string from the higher level API
905− error $ "Streamly.Mem.Array.Types.packArraysChunksOf: the size of "
905+ error $ "Streamly.Memory.Array.Types.packArraysChunksOf: the size of "
906 ++ "arrays [" ++ show n ++ "] must be a natural number"
906 ++ "arrays [" ++ show n ++ "] must be a natural number"
907 r <- step gst st
907 r <- step gst st
908 case r of
908 case r of
@@ -959,11 +959,11 @@ groupIOVecsOf n maxIOVLen (D.Stream step state) =
959 step' gst (GatherInitial st) = do
959 step' gst (GatherInitial st) = do
960 when (n <= 0) $
960 when (n <= 0) $
961 -- XXX we can pass the module string from the higher level API
961 -- XXX we can pass the module string from the higher level API
962− error $ "Streamly.Mem.Array.Types.groupIOVecsOf: the size of "
962+ error $ "Streamly.Memory.Array.Types.groupIOVecsOf: the size of "
963 ++ "groups [" ++ show n ++ "] must be a natural number"
963 ++ "groups [" ++ show n ++ "] must be a natural number"
964 when (maxIOVLen <= 0) $
964 when (maxIOVLen <= 0) $
965 -- XXX we can pass the module string from the higher level API
965 -- XXX we can pass the module string from the higher level API
966− error $ "Streamly.Mem.Array.Types.groupIOVecsOf: the number of "
966+ error $ "Streamly.Memory.Array.Types.groupIOVecsOf: the number of "
967 ++ "IOVec entries [" ++ show n ++ "] must be a natural number"
967 ++ "IOVec entries [" ++ show n ++ "] must be a natural number"
968 r <- step (adaptState gst) st
968 r <- step (adaptState gst) st
969 case r of
969 case r of
src/Streamly/Mem/ArrayStream.hs → src/Streamly/Memory/ArrayStream.hsrenamed+4−4
@@ -8,7 +8,7 @@
8#include "inline.hs"
8#include "inline.hs"
9
9
10-- |
10-- |
11−-- Module : Streamly.Mem.ArrayStream
11+-- Module : Streamly.Memory.ArrayStream
12-- Copyright : (c) 2019 Composewell Technologies
12-- Copyright : (c) 2019 Composewell Technologies
13--
13--
14-- License : BSD3
14-- License : BSD3
@@ -18,7 +18,7 @@
18--
18--
19-- Combinators to efficiently manipulate streams of arrays.
19-- Combinators to efficiently manipulate streams of arrays.
20--
20--
21−module Streamly.Mem.ArrayStream
21+module Streamly.Memory.ArrayStream
22 (
22 (
23 -- * Creation
23 -- * Creation
24 arraysOf
24 arraysOf
@@ -45,11 +45,11 @@ import Foreign.Ptr (minusPtr, plusPtr, castPtr)
45import Foreign.Storable (Storable(..))
45import Foreign.Storable (Storable(..))
46import Prelude hiding (length, null, last, map, (!!), read)
46import Prelude hiding (length, null, last, map, (!!), read)
47
47
48−import Streamly.Mem.Array.Types (Array(..), length)
48+import Streamly.Memory.Array.Types (Array(..), length)
49import Streamly.Streams.Serial (SerialT)
49import Streamly.Streams.Serial (SerialT)
50import Streamly.Streams.StreamK.Type (IsStream)
50import Streamly.Streams.StreamK.Type (IsStream)
51
51
52−import qualified Streamly.Mem.Array.Types as A
52+import qualified Streamly.Memory.Array.Types as A
53import qualified Streamly.Prelude as S
53import qualified Streamly.Prelude as S
54import qualified Streamly.Streams.StreamD as D
54import qualified Streamly.Streams.StreamD as D
55import qualified Streamly.Streams.Prelude as P
55import qualified Streamly.Streams.Prelude as P
src/Streamly/Mem/Ring.hs → src/Streamly/Memory/Ring.hsrenamed+3−3
@@ -4,7 +4,7 @@
4{-# LANGUAGE ExistentialQuantification #-}
4{-# LANGUAGE ExistentialQuantification #-}
5
5
6-- |
6-- |
7−-- Module : Streamly.Mem.Ring
7+-- Module : Streamly.Memory.Ring
8-- Copyright : (c) 2019 Composewell Technologies
8-- Copyright : (c) 2019 Composewell Technologies
9-- License : BSD3
9-- License : BSD3
10-- Maintainer : harendra.kumar@gmail.com
10-- Maintainer : harendra.kumar@gmail.com
@@ -12,7 +12,7 @@
12-- Portability : GHC
12-- Portability : GHC
13--
13--
14
14
15−module Streamly.Mem.Ring
15+module Streamly.Memory.Ring
16 ( Ring(..)
16 ( Ring(..)
17
17
18 -- * Construction
18 -- * Construction
@@ -40,7 +40,7 @@ import GHC.ForeignPtr (mallocPlainForeignPtrAlignedBytes)
40import GHC.Ptr (Ptr(..))
40import GHC.Ptr (Ptr(..))
41import Prelude hiding (length, concat)
41import Prelude hiding (length, concat)
42
42
43−import qualified Streamly.Mem.Array.Types as A
43+import qualified Streamly.Memory.Array.Types as A
44
44
45-- | A ring buffer is a mutable array of fixed size. Initially the array is
45-- | A ring buffer is a mutable array of fixed size. Initially the array is
46-- empty, with ringStart pointing at the start of allocated memory. We call the
46-- empty, with ringStart pointing at the start of allocated memory. We call the
src/Streamly/Network/Client.hs+2−2
@@ -66,11 +66,11 @@ import Prelude hiding (read)
66import qualified Network.Socket as Net
66import qualified Network.Socket as Net
67
67
68import Streamly (MonadAsync)
68import Streamly (MonadAsync)
69−import Streamly.Mem.Array.Types (Array(..), defaultChunkSize)
69+import Streamly.Memory.Array.Types (Array(..), defaultChunkSize)
70import Streamly.Streams.Serial (SerialT)
70import Streamly.Streams.Serial (SerialT)
71import Streamly.Streams.StreamK.Type (IsStream)
71import Streamly.Streams.StreamK.Type (IsStream)
72
72
73−import qualified Streamly.Mem.ArrayStream as AS
73+import qualified Streamly.Memory.ArrayStream as AS
74import qualified Streamly.Prelude as S
74import qualified Streamly.Prelude as S
75import qualified Streamly.Network.Socket as SK
75import qualified Streamly.Network.Socket as SK
76
76
src/Streamly/Network/Socket.hs+5−5
@@ -17,7 +17,7 @@
17-- Portability : GHC
17-- Portability : GHC
18--
18--
19-- Read and write streams and arrays to and from network sockets. Socket IO
19-- Read and write streams and arrays to and from network sockets. Socket IO
20−-- APIs are quite similar to "Streamly.Mem.Array" read write APIs and almost
20+-- APIs are quite similar to "Streamly.Memory.Array" read write APIs and almost
21-- identical to the sequential streaming APIs in "Streamly.FileSystem.File".
21-- identical to the sequential streaming APIs in "Streamly.FileSystem.File".
22--
22--
23-- Read IO requests to the socket are performed in chunks of 32KiB, this is
23-- Read IO requests to the socket are performed in chunks of 32KiB, this is
@@ -86,15 +86,15 @@ import Prelude hiding (read)
86
86
87import qualified Network.Socket as Net
87import qualified Network.Socket as Net
88
88
89−import Streamly.Mem.Array.Types (Array(..))
89+import Streamly.Memory.Array.Types (Array(..))
90import Streamly.Streams.Serial (SerialT)
90import Streamly.Streams.Serial (SerialT)
91import Streamly.Streams.StreamK.Type (IsStream, mkStream)
91import Streamly.Streams.StreamK.Type (IsStream, mkStream)
92-- import Streamly.Fold (Fold)
92-- import Streamly.Fold (Fold)
93-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
93-- import Streamly.String (encodeUtf8, decodeUtf8, foldLines)
94
94
95−import qualified Streamly.Mem.Array as A
95+import qualified Streamly.Memory.Array as A
96−import qualified Streamly.Mem.ArrayStream as AS
96+import qualified Streamly.Memory.ArrayStream as AS
97−import qualified Streamly.Mem.Array.Types as A hiding (flattenArrays)
97+import qualified Streamly.Memory.Array.Types as A hiding (flattenArrays)
98import qualified Streamly.Prelude as S
98import qualified Streamly.Prelude as S
99
99
100-- | @'withSocket' socket act@ runs the monadic computation @act@ passing the
100-- | @'withSocket' socket act@ runs the monadic computation @act@ passing the
src/Streamly/Pipe.hs+3−3
@@ -254,8 +254,8 @@ import Prelude
254-- import Streamly.Fold.Types (Fold(..))
254-- import Streamly.Fold.Types (Fold(..))
255import Streamly.Pipe.Types
255import Streamly.Pipe.Types
256 (Pipe(..), PipeState(..), Step(..), zipWith, tee, map, compose)
256 (Pipe(..), PipeState(..), Step(..), zipWith, tee, map, compose)
257−-- import Streamly.Mem.Array.Types (Array)
257+-- import Streamly.Memory.Array.Types (Array)
258−-- import Streamly.Mem.Ring (Ring)
258+-- import Streamly.Memory.Ring (Ring)
259-- import Streamly.Streams.Serial (SerialT)
259-- import Streamly.Streams.Serial (SerialT)
260-- import Streamly.Streams.StreamK (IsStream())
260-- import Streamly.Streams.StreamK (IsStream())
261-- import Streamly.Time.Units
261-- import Streamly.Time.Units
@@ -264,7 +264,7 @@ import Streamly.Pipe.Types
264
264
265-- import Streamly.Strict
265-- import Streamly.Strict
266
266
267−-- import qualified Streamly.Mem.Array.Types as A
267+-- import qualified Streamly.Memory.Array.Types as A
268-- import qualified Streamly.Prelude as S
268-- import qualified Streamly.Prelude as S
269-- import qualified Streamly.Streams.StreamD as D
269-- import qualified Streamly.Streams.StreamD as D
270-- import qualified Streamly.Streams.StreamK as K
270-- import qualified Streamly.Streams.StreamK as K
src/Streamly/Prelude.hs+2−2
@@ -640,7 +640,7 @@ import qualified System.IO as IO
640
640
641import Streamly.Enumeration (Enumerable(..), enumerate, enumerateTo)
641import Streamly.Enumeration (Enumerable(..), enumerate, enumerateTo)
642import Streamly.Fold.Types (Fold (..))
642import Streamly.Fold.Types (Fold (..))
643−import Streamly.Mem.Array (Array)
643+import Streamly.Memory.Array (Array)
644import Streamly.SVar (MonadAsync, defState)
644import Streamly.SVar (MonadAsync, defState)
645import Streamly.Streams.Async (mkAsync')
645import Streamly.Streams.Async (mkAsync')
646import Streamly.Streams.Combinators (maxYields)
646import Streamly.Streams.Combinators (maxYields)
@@ -656,7 +656,7 @@ import Streamly.Time.Units
656
656
657import Streamly.Strict
657import Streamly.Strict
658
658
659−import qualified Streamly.Mem.Array as A
659+import qualified Streamly.Memory.Array as A
660import qualified Streamly.Fold as FL
660import qualified Streamly.Fold as FL
661import qualified Streamly.Streams.Prelude as P
661import qualified Streamly.Streams.Prelude as P
662import qualified Streamly.Streams.StreamK as K
662import qualified Streamly.Streams.StreamK as K
src/Streamly/Streams/StreamD.hs+3−3
@@ -280,7 +280,7 @@ import Prelude
280
280
281import qualified Control.Monad.Catch as MC
281import qualified Control.Monad.Catch as MC
282
282
283−import Streamly.Mem.Array.Types (Array(..))
283+import Streamly.Memory.Array.Types (Array(..))
284import Streamly.Fold.Types (Fold(..))
284import Streamly.Fold.Types (Fold(..))
285import Streamly.Pipe.Types (Pipe(..), PipeState(..))
285import Streamly.Pipe.Types (Pipe(..), PipeState(..))
286import Streamly.SVar (MonadAsync, defState, adaptState)
286import Streamly.SVar (MonadAsync, defState, adaptState)
@@ -288,8 +288,8 @@ import Streamly.SVar (MonadAsync, defState, adaptState)
288import Streamly.Streams.StreamD.Type
288import Streamly.Streams.StreamD.Type
289
289
290import qualified Streamly.Pipe.Types as Pipe
290import qualified Streamly.Pipe.Types as Pipe
291−import qualified Streamly.Mem.Array.Types as A
291+import qualified Streamly.Memory.Array.Types as A
292−import qualified Streamly.Mem.Ring as RB
292+import qualified Streamly.Memory.Ring as RB
293import qualified Streamly.Streams.StreamK as K
293import qualified Streamly.Streams.StreamK as K
294
294
295------------------------------------------------------------------------------
295------------------------------------------------------------------------------
src/Streamly/String.hs+4−4
@@ -70,12 +70,12 @@ import GHC.Base (unsafeChr)
70import Streamly (IsStream, MonadAsync)
70import Streamly (IsStream, MonadAsync)
71import Prelude hiding (String, lines, words, unlines, unwords)
71import Prelude hiding (String, lines, words, unlines, unwords)
72import Streamly.Fold (Fold)
72import Streamly.Fold (Fold)
73−import Streamly.Mem.Array (Array)
73+import Streamly.Memory.Array (Array)
74
74
75import qualified Streamly.Prelude as S
75import qualified Streamly.Prelude as S
76−import qualified Streamly.Mem.Array.Types as A (unlines)
76+import qualified Streamly.Memory.Array.Types as A (unlines)
77−import qualified Streamly.Mem.Array as A
77+import qualified Streamly.Memory.Array as A
78−import qualified Streamly.Mem.ArrayStream as AS
78+import qualified Streamly.Memory.ArrayStream as AS
79import qualified Streamly.Streams.StreamD as D
79import qualified Streamly.Streams.StreamD as D
80
80
81-- type String = List Char
81-- type String = List Char
streamly.cabal+4−4
@@ -185,8 +185,8 @@ library
185 , Streamly.Enumeration
185 , Streamly.Enumeration
186
186
187 -- Memory storage
187 -- Memory storage
188− , Streamly.Mem.Array.Types
188+ , Streamly.Memory.Array.Types
189− , Streamly.Mem.Ring
189+ , Streamly.Memory.Ring
190
190
191 -- Base streams
191 -- Base streams
192 , Streamly.Streams.StreamK.Type
192 , Streamly.Streams.StreamK.Type
@@ -231,8 +231,8 @@ library
231 , Streamly.String
231 , Streamly.String
232
232
233 -- IO devices
233 -- IO devices
234− , Streamly.Mem.Array
234+ , Streamly.Memory.Array
235− , Streamly.Mem.ArrayStream
235+ , Streamly.Memory.ArrayStream
236 , Streamly.FileSystem.Handle
236 , Streamly.FileSystem.Handle
237
237
238 , Streamly.Tutorial
238 , Streamly.Tutorial
test/Arrays.hs+2−2
@@ -11,8 +11,8 @@ import Test.QuickCheck.Monadic (monadicIO, assert)
11
11
12import Test.Hspec as H
12import Test.Hspec as H
13
13
14−import qualified Streamly.Mem.Array as A
14+import qualified Streamly.Memory.Array as A
15−import qualified Streamly.Mem.ArrayStream as AS
15+import qualified Streamly.Memory.ArrayStream as AS
16import qualified Streamly.Prelude as S
16import qualified Streamly.Prelude as S
17
17
18-- Coverage build takes too long with default number of tests
18-- Coverage build takes too long with default number of tests
test/String.hs+2−2
@@ -12,8 +12,8 @@ import Test.QuickCheck.Monadic (run, monadicIO, assert)
12
12
13import Test.Hspec as H
13import Test.Hspec as H
14
14
15−import qualified Streamly.Mem.Array as A
15+import qualified Streamly.Memory.Array as A
16−import qualified Streamly.Mem.ArrayStream as AS
16+import qualified Streamly.Memory.ArrayStream as AS
17import qualified Streamly.Prelude as S
17import qualified Streamly.Prelude as S
18import qualified Streamly.String as SS
18import qualified Streamly.String as SS
19
19