on master help sign in
Rename Streamly.Internal.Memory.Array.Types
4070c13adithyaov
benchmark/Streamly/Benchmark/FileSystem/Handle/Read.hs+1−1
@@ -44,7 +44,7 @@ import qualified Streamly.Internal.Data.Stream.StreamD as D
44import qualified Streamly.Internal.Unicode.Stream as IUS
44import qualified Streamly.Internal.Unicode.Stream as IUS
45import qualified Streamly.Internal.FileSystem.Handle as IFH
45import qualified Streamly.Internal.FileSystem.Handle as IFH
46import qualified Streamly.Internal.Memory.Array as A
46import qualified Streamly.Internal.Memory.Array as A
47−import qualified Streamly.Internal.Memory.Array.Types as AT
47+import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as AT
48import qualified Streamly.Internal.Memory.ArrayStream as AS
48import qualified Streamly.Internal.Memory.ArrayStream as AS
49import qualified Streamly.Internal.Data.Stream.IsStream as IP
49import qualified Streamly.Internal.Data.Stream.IsStream as IP
50import qualified Streamly.Prelude as S
50import qualified Streamly.Prelude as S
benchmark/Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs+1−1
@@ -49,7 +49,7 @@ import Streamly.Internal.Data.Stream.StreamD.Type (Step(..))
49import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
49import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
50import qualified Streamly.Internal.Data.Tuple.Strict as Strict
50import qualified Streamly.Internal.Data.Tuple.Strict as Strict
51import qualified Streamly.Internal.Memory.Array as A
51import qualified Streamly.Internal.Memory.Array as A
52−import qualified Streamly.Internal.Memory.Array.Types as AT
52+import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as AT
53
53
54import Test.Inspection
54import Test.Inspection
55#endif
55#endif
src/Streamly/FileSystem/FD.hs+2−2
@@ -130,14 +130,14 @@ 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.Memory.Array.Types (Array(..), byteLength, defaultChunkSize, unsafeFreeze)
133+import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..), byteLength, defaultChunkSize, unsafeFreeze)
134import Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types (mutableArray)
134import Streamly.Internal.Data.Array.Storable.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)
138
138
139#if !defined(mingw32_HOST_OS)
139#if !defined(mingw32_HOST_OS)
140−import Streamly.Internal.Memory.Array.Types (groupIOVecsOf)
140+import Streamly.Internal.Data.Array.Storable.Foreign.Types (groupIOVecsOf)
141import Streamly.Internal.Data.Stream.StreamD (toStreamD)
141import Streamly.Internal.Data.Stream.StreamD (toStreamD)
142import Streamly.Internal.Data.Stream.StreamD.Type (fromStreamD)
142import Streamly.Internal.Data.Stream.StreamD.Type (fromStreamD)
143import qualified Streamly.FileSystem.FDIO as RawIO hiding (write)
143import qualified Streamly.FileSystem.FDIO as RawIO hiding (write)
src/Streamly/FileSystem/Handle.hs+2−2
@@ -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.Memory.Array.Types.defaultChunkSize' in the
47+ -- 'Streamly.Internal.Data.Array.Storable.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.Memory.Array.Types.defaultChunkSize' before they
52+ -- of 'Streamly.Internal.Data.Array.Storable.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/Prim/TypesInclude.hs+2−2
@@ -551,7 +551,7 @@ packArraysChunksOf n (D.Stream step state) =
551 step' gst (SpliceInitial st) = do
551 step' gst (SpliceInitial st) = do
552 when (n <= 0) $
552 when (n <= 0) $
553 -- XXX we can pass the module string from the higher level API
553 -- XXX we can pass the module string from the higher level API
554− error $ "Streamly.Internal.Memory.Array.Types.packArraysChunksOf: the size of "
554+ error $ "Streamly.Internal.Data.Array.Storable.Foreign.Types.packArraysChunksOf: the size of "
555 ++ "arrays [" ++ show n ++ "] must be a natural number"
555 ++ "arrays [" ++ show n ++ "] must be a natural number"
556 r <- step gst st
556 r <- step gst st
557 case r of
557 case r of
@@ -601,7 +601,7 @@ lpackArraysChunksOf n (Fold step1 initial1 extract1) =
601 initial = do
601 initial = do
602 when (n <= 0) $
602 when (n <= 0) $
603 -- XXX we can pass the module string from the higher level API
603 -- XXX we can pass the module string from the higher level API
604− error $ "Streamly.Internal.Memory.Array.Types.packArraysChunksOf: the size of "
604+ error $ "Streamly.Internal.Data.Array.Storable.Foreign.Types.packArraysChunksOf: the size of "
605 ++ "arrays [" ++ show n ++ "] must be a natural number"
605 ++ "arrays [" ++ show n ++ "] must be a natural number"
606 r1 <- initial1
606 r1 <- initial1
607 return (Tuple3' Nothing' 0 r1)
607 return (Tuple3' Nothing' 0 r1)
src/Streamly/Internal/Memory/Array/Types.hs → src/Streamly/Internal/Data/Array/Storable/Foreign/Types.hsrenamed+2−2
@@ -1,7 +1,7 @@
1#include "inline.hs"
1#include "inline.hs"
2
2
3-- |
3-- |
4−-- Module : Streamly.Internal.Memory.Array.Types
4+-- Module : Streamly.Internal.Data.Array.Storable.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,7 +9,7 @@
9-- Stability : experimental
9-- Stability : experimental
10-- Portability : GHC
10-- Portability : GHC
11--
11--
12−module Streamly.Internal.Memory.Array.Types
12+module Streamly.Internal.Data.Array.Storable.Foreign.Types
13 (
13 (
14 Array (..)
14 Array (..)
15
15
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.Memory.Array.Types (Array)
249+-- import Streamly.Internal.Data.Array.Storable.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.Memory.Array.Types as A
259+-- import qualified Streamly.Internal.Data.Array.Storable.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/Stream/IsStream.hs+1−1
@@ -554,7 +554,7 @@ import Streamly.Internal.Data.Stream.Enumeration
554import Streamly.Internal.Data.Fold.Types (Fold (..), Fold2 (..))
554import Streamly.Internal.Data.Fold.Types (Fold (..), Fold2 (..))
555import Streamly.Internal.Data.Parser (Parser (..))
555import Streamly.Internal.Data.Parser (Parser (..))
556import Streamly.Internal.Data.Unfold.Types (Unfold)
556import Streamly.Internal.Data.Unfold.Types (Unfold)
557−import Streamly.Internal.Memory.Array.Types (Array, writeNUnsafe)
557+import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array, writeNUnsafe)
558import Streamly.Internal.Data.SVar (MonadAsync, defState, Rate)
558import Streamly.Internal.Data.SVar (MonadAsync, defState, Rate)
559import Streamly.Internal.Data.Stream.Combinators (inspectMode, maxYields)
559import Streamly.Internal.Data.Stream.Combinators (inspectMode, maxYields)
560import Streamly.Internal.Data.Stream.Prelude
560import Streamly.Internal.Data.Stream.Prelude
src/Streamly/Internal/Data/Stream/StreamD.hs+2−2
@@ -329,7 +329,7 @@ import Streamly.Internal.Data.IORef.Prim (Prim)
329import Streamly.Internal.Data.Time.Units
329import Streamly.Internal.Data.Time.Units
330 (TimeUnit64, toRelTime64, diffAbsTime64, RelTime64)
330 (TimeUnit64, toRelTime64, diffAbsTime64, RelTime64)
331import Streamly.Internal.Data.Atomics (atomicModifyIORefCAS_)
331import Streamly.Internal.Data.Atomics (atomicModifyIORefCAS_)
332−import Streamly.Internal.Memory.Array.Types (Array(..))
332+import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..))
333import Streamly.Internal.Data.Fold.Types (Fold(..))
333import Streamly.Internal.Data.Fold.Types (Fold(..))
334import Streamly.Internal.Data.Parser (ParseError(..))
334import Streamly.Internal.Data.Parser (ParseError(..))
335import Streamly.Internal.Data.Pipe.Types (Pipe(..), PipeState(..))
335import Streamly.Internal.Data.Pipe.Types (Pipe(..), PipeState(..))
@@ -342,7 +342,7 @@ import Streamly.Internal.Data.Stream.SVar (fromConsumer, pushToFold)
342
342
343import qualified Streamly.Internal.Data.IORef.Prim as Prim
343import qualified Streamly.Internal.Data.IORef.Prim as Prim
344import qualified Streamly.Internal.Data.Pipe.Types as Pipe
344import qualified Streamly.Internal.Data.Pipe.Types as Pipe
345−import qualified Streamly.Internal.Memory.Array.Types as A
345+import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
346import qualified Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types as MA
346import qualified Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types as MA
347import qualified Streamly.Internal.Data.Fold as FL
347import qualified Streamly.Internal.Data.Fold as FL
348import qualified Streamly.Memory.Ring as RB
348import qualified Streamly.Memory.Ring as RB
src/Streamly/Internal/FileSystem/Dir.hs+5−5
@@ -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.Memory.Array.Types
67+-- import Streamly.Internal.Data.Array.Storable.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)
@@ -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.Memory.Array.Types.defaultChunkSize'. The
169+-- 'Streamly.Internal.Data.Array.Storable.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.Memory.Array.Types.defaultChunkSize'.
171+-- 'Streamly.Internal.Data.Array.Storable.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.Memory.Array.Types.defaultChunkSize' before writing.
346+-- up to 'Streamly.Internal.Data.Array.Storable.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.lchunksOf 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.Memory.Array.Types.defaultChunkSize' before writing
396+-- up to 'Streamly.Internal.Data.Array.Storable.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+1−1
@@ -165,7 +165,7 @@ import GHC.IO.Handle.FD (fdToHandle)
165import Streamly (SerialT)
165import Streamly (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.Memory.Array.Types (Array(..))
168+import Streamly.Internal.Data.Array.Storable.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
src/Streamly/Internal/FileSystem/Event/Linux.hs+1−1
@@ -161,7 +161,7 @@ import GHC.IO.FD (fdFD, mkFD)
161import GHC.IO.Handle.FD (mkHandleFromFD)
161import GHC.IO.Handle.FD (mkHandleFromFD)
162import Streamly (SerialT)
162import Streamly (SerialT)
163import Streamly.Internal.Data.Parser (Parser)
163import Streamly.Internal.Data.Parser (Parser)
164−import Streamly.Internal.Memory.Array.Types (Array(..))
164+import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..))
165import System.IO (Handle, hClose, IOMode(ReadMode))
165import System.IO (Handle, hClose, IOMode(ReadMode))
166#if !MIN_VERSION_base(4,10,0)
166#if !MIN_VERSION_base(4,10,0)
167import Control.Concurrent.MVar (readMVar)
167import Control.Concurrent.MVar (readMVar)
src/Streamly/Internal/FileSystem/File.hs+5−5
@@ -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.Memory.Array.Types
99+import Streamly.Internal.Data.Array.Storable.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)
@@ -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.Memory.Array.Types.defaultChunkSize'. The
246+-- 'Streamly.Internal.Data.Array.Storable.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.Memory.Array.Types.defaultChunkSize'.
248+-- 'Streamly.Internal.Data.Array.Storable.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.Memory.Array.Types.defaultChunkSize'.
265+-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'.
266--
266--
267-- @since 0.7.0
267-- @since 0.7.0
268{-# INLINE read #-}
268{-# INLINE read #-}
@@ -379,7 +379,7 @@ writeWithBufferOf n path =
379-- > write = 'writeWithBufferOf' A.defaultChunkSize
379-- > write = 'writeWithBufferOf' A.defaultChunkSize
380--
380--
381-- | Write a byte stream to a file. Accumulates the input in chunks of up to
381-- | Write a byte stream to a file. Accumulates the input in chunks of up to
382−-- 'Streamly.Internal.Memory.Array.Types.defaultChunkSize' before writing to
382+-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize' before writing to
383-- the IO device.
383-- the IO device.
384--
384--
385-- /Internal/
385-- /Internal/
src/Streamly/Internal/FileSystem/Handle.hs+6−6
@@ -113,7 +113,7 @@ import Streamly (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.Memory.Array.Types
116+import Streamly.Internal.Data.Array.Storable.Foreign.Types
117 (Array(..), writeNUnsafe, defaultChunkSize, lpackArraysChunksOf
117 (Array(..), writeNUnsafe, defaultChunkSize, lpackArraysChunksOf
118 , unsafeFreezeWithShrink)
118 , unsafeFreezeWithShrink)
119import Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types (mutableArray)
119import Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types (mutableArray)
@@ -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.Memory.Array.Types.defaultChunkSize'. The
258+-- 'Streamly.Internal.Data.Array.Storable.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.Memory.Array.Types.defaultChunkSize'.
260+-- 'Streamly.Internal.Data.Array.Storable.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.Memory.Array.Types.defaultChunkSize'.
297+-- 'Streamly.Internal.Data.Array.Storable.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.Memory.Array.Types.defaultChunkSize' before writing.
414+-- up to 'Streamly.Internal.Data.Array.Storable.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.lchunksOf2 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.Memory.Array.Types.defaultChunkSize' before writing
472+-- up to 'Streamly.Internal.Data.Array.Storable.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/Array.hs+2−2
@@ -159,11 +159,11 @@ import GHC.IO (IO(..))
159
159
160import Streamly.Internal.Data.Fold.Types (Fold(..))
160import Streamly.Internal.Data.Fold.Types (Fold(..))
161import Streamly.Internal.Data.Unfold.Types (Unfold(..))
161import Streamly.Internal.Data.Unfold.Types (Unfold(..))
162−import Streamly.Internal.Memory.Array.Types (Array(..), length)
162+import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..), length)
163import Streamly.Internal.Data.Stream.Serial (SerialT)
163import Streamly.Internal.Data.Stream.Serial (SerialT)
164import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
164import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
165
165
166−import qualified Streamly.Internal.Memory.Array.Types as A
166+import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
167import qualified Streamly.Internal.Data.Stream.Prelude as P
167import qualified Streamly.Internal.Data.Stream.Prelude as P
168import qualified Streamly.Internal.Data.Stream.Serial as Serial
168import qualified Streamly.Internal.Data.Stream.Serial as Serial
169import qualified Streamly.Internal.Data.Stream.StreamD as D
169import qualified Streamly.Internal.Data.Stream.StreamD as D
src/Streamly/Internal/Memory/ArrayStream.hs+2−2
@@ -41,12 +41,12 @@ import Foreign.Ptr (minusPtr, plusPtr, castPtr)
41import Foreign.Storable (Storable(..))
41import Foreign.Storable (Storable(..))
42import Prelude hiding (length, null, last, map, (!!), read, concat)
42import Prelude hiding (length, null, last, map, (!!), read, concat)
43
43
44−import Streamly.Internal.Memory.Array.Types (Array(..), length)
44+import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..), length)
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)
47
47
48import qualified Streamly.Internal.Memory.Array as A
48import qualified Streamly.Internal.Memory.Array as A
49−import qualified Streamly.Internal.Memory.Array.Types as A
49+import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
50import qualified Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types as MA
50import qualified Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types as MA
51import qualified Streamly.Internal.Data.Stream.IsStream as S
51import qualified Streamly.Internal.Data.Stream.IsStream as S
52import qualified Streamly.Internal.Data.Stream.StreamD as D
52import qualified Streamly.Internal.Data.Stream.StreamD as D
src/Streamly/Internal/Network/Inet/TCP.hs+1−1
@@ -109,7 +109,7 @@ import Streamly.Internal.Data.SVar (fork)
109import Streamly.Internal.Data.Unfold.Types (Unfold(..))
109import Streamly.Internal.Data.Unfold.Types (Unfold(..))
110import Streamly.Internal.Network.Socket (SockSpec(..), accept, connections)
110import Streamly.Internal.Network.Socket (SockSpec(..), accept, connections)
111import Streamly.Internal.Data.Stream.Serial (SerialT)
111import Streamly.Internal.Data.Stream.Serial (SerialT)
112−import Streamly.Internal.Memory.Array.Types (Array(..), defaultChunkSize, writeNUnsafe)
112+import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..), defaultChunkSize, writeNUnsafe)
113import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
113import Streamly.Internal.Data.Stream.StreamK.Type (IsStream)
114
114
115import qualified Control.Monad.Catch as MC
115import qualified Control.Monad.Catch as MC
src/Streamly/Internal/Network/Socket.hs+5−5
@@ -89,7 +89,7 @@ import qualified Network.Socket as Net
89
89
90import Streamly (MonadAsync)
90import Streamly (MonadAsync)
91import Streamly.Internal.Data.Unfold.Types (Unfold(..))
91import Streamly.Internal.Data.Unfold.Types (Unfold(..))
92−import Streamly.Internal.Memory.Array.Types (Array(..), lpackArraysChunksOf)
92+import Streamly.Internal.Data.Array.Storable.Foreign.Types (Array(..), lpackArraysChunksOf)
93import Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types (mutableArray)
93import Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types (mutableArray)
94import Streamly.Internal.Data.Stream.Serial (SerialT)
94import Streamly.Internal.Data.Stream.Serial (SerialT)
95import Streamly.Internal.Data.Stream.StreamK.Type (IsStream, mkStream)
95import Streamly.Internal.Data.Stream.StreamK.Type (IsStream, mkStream)
@@ -102,7 +102,7 @@ import qualified Streamly.Internal.Data.Unfold as UF
102import qualified Streamly.Internal.Memory.Array as IA
102import qualified Streamly.Internal.Memory.Array as IA
103import qualified Streamly.Memory.Array as A
103import qualified Streamly.Memory.Array as A
104import qualified Streamly.Internal.Memory.ArrayStream as AS
104import qualified Streamly.Internal.Memory.ArrayStream as AS
105−import qualified Streamly.Internal.Memory.Array.Types as A
105+import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
106import qualified Streamly.Prelude as S
106import qualified Streamly.Prelude as S
107import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
107import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
108
108
@@ -380,9 +380,9 @@ readChunksWithBufferOf = Unfold step return
380
380
381-- | Unfolds a socket into a stream of 'Word8' arrays. Requests to the socket
381-- | Unfolds a socket into a stream of 'Word8' arrays. Requests to the socket
382-- are performed using a buffer of size
382-- are performed using a buffer of size
383−-- 'Streamly.Internal.Memory.Array.Types.defaultChunkSize'. The
383+-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'. The
384-- size of arrays in the resulting stream are therefore less than or equal to
384-- size of arrays in the resulting stream are therefore less than or equal to
385−-- 'Streamly.Internal.Memory.Array.Types.defaultChunkSize'.
385+-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'.
386--
386--
387-- @since 0.7.0
387-- @since 0.7.0
388{-# INLINE readChunks #-}
388{-# INLINE readChunks #-}
@@ -429,7 +429,7 @@ readWithBufferOf = UF.concat readChunksWithBufferOf A.read
429
429
430-- | Unfolds a 'Socket' into a byte stream. IO requests to the socket are
430-- | Unfolds a 'Socket' into a byte stream. IO requests to the socket are
431-- performed in sizes of
431-- performed in sizes of
432−-- 'Streamly.Internal.Memory.Array.Types.defaultChunkSize'.
432+-- 'Streamly.Internal.Data.Array.Storable.Foreign.Types.defaultChunkSize'.
433--
433--
434-- @since 0.7.0
434-- @since 0.7.0
435{-# INLINE read #-}
435{-# INLINE read #-}
src/Streamly/Internal/Unicode/Stream.hs+1−1
@@ -74,7 +74,7 @@ import Streamly.Internal.Data.SVar (adaptState)
74import Streamly.Internal.Data.Stream.StreamD (Stream(..), Step (..))
74import Streamly.Internal.Data.Stream.StreamD (Stream(..), Step (..))
75import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
75import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
76
76
77−import qualified Streamly.Internal.Memory.Array.Types as A
77+import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
78import qualified Streamly.Internal.Data.Stream.IsStream as S
78import qualified Streamly.Internal.Data.Stream.IsStream as S
79import qualified Streamly.Internal.Data.Stream.StreamD as D
79import qualified Streamly.Internal.Data.Stream.StreamD as D
80
80
src/Streamly/Memory/Ring.hs+1−1
@@ -37,7 +37,7 @@ import Prelude hiding (length, concat)
37
37
38import Control.Monad.IO.Class (MonadIO(..))
38import Control.Monad.IO.Class (MonadIO(..))
39
39
40−import qualified Streamly.Internal.Memory.Array.Types as A
40+import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
41
41
42-- | A ring buffer is a mutable array of fixed size. Initially the array is
42-- | A ring buffer is a mutable array of fixed size. Initially the array is
43-- empty, with ringStart pointing at the start of allocated memory. We call the
43-- empty, with ringStart pointing at the start of allocated memory. We call the
src/Streamly/Network/Socket.hs+2−2
@@ -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.Memory.Array.Types.defaultChunkSize'. Unless specified
67+-- 'Streamly.Internal.Data.Array.Storable.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.Memory.Array.Types.defaultChunkSize' before they are
69+-- 'Streamly.Internal.Data.Array.Storable.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
streamly.cabal+1−1
@@ -430,7 +430,7 @@ library
430 , Streamly.Internal.Data.SmallArray.Types
430 , Streamly.Internal.Data.SmallArray.Types
431 , Streamly.Internal.Data.SmallArray
431 , Streamly.Internal.Data.SmallArray
432 , Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types
432 , Streamly.Internal.Data.Array.Storable.Foreign.Mut.Types
433− , Streamly.Internal.Memory.Array.Types
433+ , Streamly.Internal.Data.Array.Storable.Foreign.Types
434 , Streamly.Internal.Memory.Array
434 , Streamly.Internal.Memory.Array
435 , Streamly.Internal.Memory.ArrayStream
435 , Streamly.Internal.Memory.ArrayStream
436
436
test/Streamly/Test/Array.hs+1−1
@@ -26,7 +26,7 @@ import qualified Streamly.Internal.Data.SmallArray as A
26type Array = A.SmallArray
26type Array = A.SmallArray
27#elif defined(TEST_ARRAY)
27#elif defined(TEST_ARRAY)
28import qualified Streamly.Internal.Memory.Array as A
28import qualified Streamly.Internal.Memory.Array as A
29−import qualified Streamly.Internal.Memory.Array.Types as A
29+import qualified Streamly.Internal.Data.Array.Storable.Foreign.Types as A
30import qualified Streamly.Internal.Data.Stream.IsStream as IP
30import qualified Streamly.Internal.Data.Stream.IsStream as IP
31type Array = A.Array
31type Array = A.Array
32#elif defined(DATA_ARRAY_PRIM_PINNED)
32#elif defined(DATA_ARRAY_PRIM_PINNED)