on master help sign in
Replace Data.Strict with Data.*.Strict

"Streamly.Internal.Data.Strict" is replaced by: Streamly.Internal.Data.Tuple.Strict Streamly.Internal.Data.Maybe.Strict Streamly.Internal.Data.Either.Strict This commit also has some formatting changes to imports.

commitead160114841a24b1d9b216fb0827f5941771f55 authoradithyaov <adi.obilisetty@gmail.com> dateWed 5 Aug 2020, 23:06 (6 years ago) parentecef82f
20 files changed+188−158
benchmark/Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs+1−1 src/Streamly/Internal/Data/Array/Prim/MutTypesInclude.hs+1−1 src/Streamly/Internal/Data/Array/Prim/TypesInclude.hs+2−1 src/Streamly/Internal/Data/Binary/Decode.hs+2−1 src/Streamly/Internal/Data/Either/Strict.hs+26 src/Streamly/Internal/Data/Fold.hs+13−13 src/Streamly/Internal/Data/Fold/Types.hs+2−1 src/Streamly/Internal/Data/Maybe/Strict.hs+33 src/Streamly/Internal/Data/Parser/ParserD.hs+3−3 src/Streamly/Internal/Data/Parser/ParserD/Types.hs+3−3 src/Streamly/Internal/Data/Pipe/Types.hs+1−1 src/Streamly/Internal/Data/Stream/Serial.hs+9−8 src/Streamly/Internal/Data/Stream/StreamD.hs+14−17 src/Streamly/Internal/Data/Stream/Zip.hs+6−6 src/Streamly/Internal/Data/Strict.hs−59 src/Streamly/Internal/Data/Tuple/Strict.hs+35 src/Streamly/Internal/Data/Unicode/Stream.hs+3−3 src/Streamly/Internal/Memory/Mutable/Array/Types.hs+10−13 src/Streamly/Internal/Prelude.hs+21−26 streamly.cabal+3−1
benchmark/Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs+1−1
@@ -47,7 +47,7 @@ import Foreign.Storable (Storable)
4747import Streamly.Internal.Data.Stream.StreamD.Type (Step(..))
4848
4949import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
50−import qualified Streamly.Internal.Data.Strict as Strict
50+import qualified Streamly.Internal.Data.Tuple.Strict as Strict
5151import qualified Streamly.Internal.Memory.Array as A
5252import qualified Streamly.Internal.Memory.Array.Types as AT
5353
src/Streamly/Internal/Data/Array/Prim/MutTypesInclude.hs+1−1
@@ -9,7 +9,7 @@ import Control.Monad.IO.Class (MonadIO(..))
99import Data.Primitive.Types (Prim(..), sizeOf)
1010import Streamly.Internal.Data.Fold.Types (Fold(..))
1111import Streamly.Internal.Data.SVar (adaptState)
12−import Streamly.Internal.Data.Strict (Tuple'(..), Tuple3'(..))
12+import Streamly.Internal.Data.Tuple.Strict (Tuple'(..), Tuple3'(..))
1313
1414import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
1515
src/Streamly/Internal/Data/Array/Prim/TypesInclude.hs+2−1
@@ -13,7 +13,8 @@ import Data.Primitive.Types (Prim(..), sizeOf)
1313import Data.Semigroup (Semigroup(..))
1414#endif
1515import Data.Word (Word8)
16−import Streamly.Internal.Data.Strict (Tuple3'(..), Maybe'(..))
16+import Streamly.Internal.Data.Tuple.Strict (Tuple3'(..))
17+import Streamly.Internal.Data.Maybe.Strict (Maybe'(..))
1718import Streamly.Internal.Data.Fold.Types (Fold(..))
1819import Streamly.Internal.Data.SVar (adaptState)
1920import System.IO.Unsafe (unsafePerformIO)
src/Streamly/Internal/Data/Binary/Decode.hs+2−1
@@ -29,7 +29,8 @@ import Control.Monad.IO.Class (MonadIO)
2929import Data.Bits ((.|.), unsafeShiftL)
3030import Data.Word (Word8, Word16, Word32, Word64)
3131import Streamly.Internal.Data.Parser (Parser)
32−import Streamly.Internal.Data.Strict (Maybe'(..), Tuple' (..))
32+import Streamly.Internal.Data.Maybe.Strict (Maybe'(..))
33+import Streamly.Internal.Data.Tuple.Strict (Tuple' (..))
3334
3435import qualified Streamly.Internal.Memory.Array as A
3536import qualified Streamly.Internal.Data.Parser as PR
src/Streamly/Internal/Data/Either/Strict.hsnew file+26
@@ -0,0 +1,26 @@
1+-- |
2+-- Module : Streamly.Internal.Data.Either.Strict
3+-- Copyright : (c) 2019 Composewell Technologies
4+-- (c) 2013 Gabriel Gonzalez
5+-- License : BSD3
6+-- Maintainer : streamly@composewell.com
7+-- Stability : experimental
8+-- Portability : GHC
9+--
10+-- | Strict data types to be used as accumulator for strict left folds and
11+-- scans. For more comprehensive strict data types see
12+-- https://hackage.haskell.org/package/strict-base-types . The names have been
13+-- suffixed by a prime so that programmers can easily distinguish the strict
14+-- versions from the lazy ones.
15+--
16+-- One major advantage of strict data structures as accumulators in folds and
17+-- scans is that it helps the compiler optimize the code much better by
18+-- unboxing. In a big tight loop the difference could be huge.
19+--
20+module Streamly.Internal.Data.Either.Strict
21+ ( Either' (..)
22+ )
23+where
24+
25+-- | A strict 'Either'
26+data Either' a b = Left' !a | Right' !b deriving Show
src/Streamly/Internal/Data/Fold.hs+13−13
@@ -211,24 +211,24 @@ import Data.Map.Strict (Map)
211211#if __GLASGOW_HASKELL__ < 804
212212import Data.Semigroup (Semigroup((<>)))
213213#endif
214+import Streamly.Internal.Data.Pipe.Types (Pipe (..), PipeState(..))
215+import Streamly.Internal.Data.Tuple.Strict (Tuple'(..), Tuple3'(..))
216+import Streamly.Internal.Data.Either.Strict (Either'(..))
217+import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
214218
215−import Prelude
216− hiding (filter, drop, dropWhile, take, takeWhile, zipWith,
217− foldl, map, mapM_, sequence, all, any, sum, product, elem,
218− notElem, maximum, minimum, head, last, tail, length, null,
219− reverse, iterate, init, and, or, lookup, (!!),
220− scanl, scanl1, replicate, concatMap, mconcat, foldMap, unzip,
221− span, splitAt, break, mapM)
222−
219+import qualified Streamly.Internal.Data.Pipe.Types as Pipe
223220import qualified Data.Map.Strict as Map
224221import qualified Prelude
225222
226−import Streamly.Internal.Data.Pipe.Types (Pipe (..), PipeState(..))
227−import Streamly.Internal.Data.Fold.Types
228−import Streamly.Internal.Data.Strict
223+import Prelude hiding
224+ ( filter, drop, dropWhile, take, takeWhile, zipWith
225+ , foldl, map, mapM_, sequence, all, any, sum, product, elem
226+ , notElem, maximum, minimum, head, last, tail, length, null
227+ , reverse, iterate, init, and, or, lookup, (!!)
228+ , scanl, scanl1, replicate, concatMap, mconcat, foldMap, unzip
229+ , span, splitAt, break, mapM)
229230import Streamly.Internal.Data.SVar
230−
231−import qualified Streamly.Internal.Data.Pipe.Types as Pipe
231+import Streamly.Internal.Data.Fold.Types
232232
233233------------------------------------------------------------------------------
234234-- Smart constructors
src/Streamly/Internal/Data/Fold/Types.hs+2−1
@@ -152,7 +152,8 @@ import Data.Maybe (isJust, fromJust)
152152#if __GLASGOW_HASKELL__ < 808
153153import Data.Semigroup (Semigroup(..))
154154#endif
155−import Streamly.Internal.Data.Strict (Tuple'(..), Tuple3'(..), Either'(..))
155+import Streamly.Internal.Data.Tuple.Strict (Tuple'(..), Tuple3'(..))
156+import Streamly.Internal.Data.Either.Strict (Either'(..))
156157import Streamly.Internal.Data.SVar (MonadAsync)
157158
158159------------------------------------------------------------------------------
src/Streamly/Internal/Data/Maybe/Strict.hsnew file+33
@@ -0,0 +1,33 @@
1+-- |
2+-- Module : Streamly.Internal.Data.Maybe.Strict
3+-- Copyright : (c) 2019 Composewell Technologies
4+-- (c) 2013 Gabriel Gonzalez
5+-- License : BSD3
6+-- Maintainer : streamly@composewell.com
7+-- Stability : experimental
8+-- Portability : GHC
9+--
10+-- | Strict data types to be used as accumulator for strict left folds and
11+-- scans. For more comprehensive strict data types see
12+-- https://hackage.haskell.org/package/strict-base-types . The names have been
13+-- suffixed by a prime so that programmers can easily distinguish the strict
14+-- versions from the lazy ones.
15+--
16+-- One major advantage of strict data structures as accumulators in folds and
17+-- scans is that it helps the compiler optimize the code much better by
18+-- unboxing. In a big tight loop the difference could be huge.
19+--
20+module Streamly.Internal.Data.Maybe.Strict
21+ ( Maybe' (..)
22+ , toMaybe
23+ )
24+where
25+
26+-- | A strict 'Maybe'
27+data Maybe' a = Just' !a | Nothing' deriving Show
28+
29+-- | Convert strict Maybe' to lazy Maybe
30+{-# INLINABLE toMaybe #-}
31+toMaybe :: Maybe' a -> Maybe a
32+toMaybe Nothing' = Nothing
33+toMaybe (Just' a) = Just a
src/Streamly/Internal/Data/Parser/ParserD.hs+3−3
@@ -160,13 +160,13 @@ where
160160
161161import Control.Exception (assert)
162162import Control.Monad.Catch (MonadCatch, MonadThrow(..))
163−import Prelude
164− hiding (any, all, take, takeWhile, sequence, concatMap, maybe, either)
165163import Streamly.Internal.Data.Fold.Types (Fold(..))
164+import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
166165
166+import Prelude hiding
167+ (any, all, take, takeWhile, sequence, concatMap, maybe, either)
167168import Streamly.Internal.Data.Parser.ParserD.Tee
168169import Streamly.Internal.Data.Parser.ParserD.Types
169−import Streamly.Internal.Data.Strict
170170
171171-------------------------------------------------------------------------------
172172-- Upgrade folds to parses
src/Streamly/Internal/Data/Parser/ParserD/Types.hs+3−3
@@ -133,11 +133,11 @@ import Control.Applicative (Alternative(..))
133133import Control.Exception (assert, Exception(..))
134134import Control.Monad (MonadPlus(..))
135135import Control.Monad.Catch (MonadCatch, try, throwM, MonadThrow)
136−import Prelude hiding (concatMap)
137−
138136import Fusion.Plugin.Types (Fuse(..))
139137import Streamly.Internal.Data.Fold (Fold(..), toList)
140−import Streamly.Internal.Data.Strict (Tuple3'(..))
138+import Streamly.Internal.Data.Tuple.Strict (Tuple3'(..))
139+
140+import Prelude hiding (concatMap)
141141
142142-- | The return type of a 'Parser' step.
143143--
src/Streamly/Internal/Data/Pipe/Types.hs+1−1
@@ -26,7 +26,7 @@ import Data.Maybe (isJust)
2626import Data.Semigroup (Semigroup(..))
2727#endif
2828import Prelude hiding (zipWith, map, id, unzip, null)
29−import Streamly.Internal.Data.Strict (Tuple'(..), Tuple3'(..))
29+import Streamly.Internal.Data.Tuple.Strict (Tuple'(..), Tuple3'(..))
3030
3131import qualified Prelude
3232
src/Streamly/Internal/Data/Stream/Serial.hs+9−8
@@ -48,7 +48,6 @@ import Control.DeepSeq (NFData1(..))
4848#endif
4949import Control.Monad.Base (MonadBase(..), liftBaseDefault)
5050import Control.Monad.Catch (MonadThrow, throwM)
51−-- import Control.Monad.Error.Class (MonadError(..))
5251import Control.Monad.IO.Class (MonadIO(..))
5352import Control.Monad.Reader.Class (MonadReader(..))
5453import Control.Monad.State.Class (MonadState(..))
@@ -61,18 +60,20 @@ import Data.Semigroup (Endo(..))
6160import Data.Semigroup (Semigroup(..))
6261#endif
6362import GHC.Exts (IsList(..), IsString(..))
64−import Text.Read (Lexeme(Ident), lexP, parens, prec, readPrec, readListPrec,
65− readListPrecDefault)
66−import Prelude hiding (map, mapM, errorWithoutStackTrace)
67−
63+import Text.Read
64+ ( Lexeme(Ident), lexP, parens, prec, readPrec, readListPrec
65+ , readListPrecDefault)
6866import Streamly.Internal.BaseCompat ((#.), errorWithoutStackTrace)
69−import Streamly.Internal.Data.Stream.StreamK (IsStream(..), adapt, Stream, mkStream,
70− foldStream)
71−import Streamly.Internal.Data.Strict (Maybe'(..), toMaybe)
67+import Streamly.Internal.Data.Stream.StreamK
68+ (IsStream(..), adapt, Stream, mkStream, foldStream)
69+import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
70+
7271import qualified Streamly.Internal.Data.Stream.Prelude as P
7372import qualified Streamly.Internal.Data.Stream.StreamK as K
7473import qualified Streamly.Internal.Data.Stream.StreamD as D
7574
75+import Prelude hiding (map, mapM, errorWithoutStackTrace)
76+
7677#include "Instances.hs"
7778#include "inline.hs"
7879
src/Streamly/Internal/Data/Stream/StreamD.hs+14−17
@@ -322,24 +322,11 @@ import Foreign.Ptr (Ptr)
322322import Foreign.Storable (Storable(..))
323323import GHC.Types (SPEC(..))
324324import System.Mem (performMajorGC)
325−import Prelude
326− hiding (map, mapM, mapM_, repeat, foldr, last, take, filter,
327− takeWhile, drop, dropWhile, all, any, maximum, minimum, elem,
328− notElem, null, head, tail, zipWith, lookup, foldr1, sequence,
329− (!!), scanl, scanl1, concatMap, replicate, enumFromTo, concat,
330− reverse, iterate, splitAt)
331−
332−import qualified Control.Monad.Catch as MC
333−import qualified Control.Monad.Trans.Reader as Reader
334−import qualified Control.Monad.Trans.State.Strict as State
335−import qualified Prelude
336−
337325import Fusion.Plugin.Types (Fuse(..))
338326import Streamly.Internal.Mutable.Prim.Var
339327 (Prim, Var, readVar, newVar, modifyVar')
340328import Streamly.Internal.Data.Time.Units
341329 (TimeUnit64, toRelTime64, diffAbsTime64, RelTime64)
342−
343330import Streamly.Internal.Data.Atomics (atomicModifyIORefCAS_)
344331import Streamly.Internal.Memory.Array.Types (Array(..))
345332import Streamly.Internal.Data.Fold.Types (Fold(..))
@@ -349,10 +336,7 @@ import Streamly.Internal.Data.Time.Clock (Clock(Monotonic), getTime)
349336import Streamly.Internal.Data.Time.Units
350337 (MicroSecond64(..), fromAbsTime, toAbsTime, AbsTime)
351338import Streamly.Internal.Data.Unfold.Types (Unfold(..))
352−import Streamly.Internal.Data.Strict (Tuple3'(..))
353−
354−import Streamly.Internal.Data.Stream.StreamD.Type
355−import Streamly.Internal.Data.SVar
339+import Streamly.Internal.Data.Tuple.Strict (Tuple3'(..))
356340import Streamly.Internal.Data.Stream.SVar (fromConsumer, pushToFold)
357341
358342import qualified Streamly.Internal.Data.Pipe.Types as Pipe
@@ -363,6 +347,19 @@ import qualified Streamly.Memory.Ring as RB
363347import qualified Streamly.Internal.Data.Stream.StreamK as K
364348import qualified Streamly.Internal.Data.Parser as PR
365349import qualified Streamly.Internal.Data.Parser.ParserD as PRD
350+import qualified Control.Monad.Catch as MC
351+import qualified Control.Monad.Trans.Reader as Reader
352+import qualified Control.Monad.Trans.State.Strict as State
353+import qualified Prelude
354+
355+import Prelude hiding
356+ ( map, mapM, mapM_, repeat, foldr, last, take, filter
357+ , takeWhile, drop, dropWhile, all, any, maximum, minimum, elem
358+ , notElem, null, head, tail, zipWith, lookup, foldr1, sequence
359+ , (!!), scanl, scanl1, concatMap, replicate, enumFromTo, concat
360+ , reverse, iterate, splitAt)
361+import Streamly.Internal.Data.Stream.StreamD.Type
362+import Streamly.Internal.Data.SVar
366363
367364------------------------------------------------------------------------------
368365-- Construction
src/Streamly/Internal/Data/Stream/Zip.hs+6−6
@@ -45,25 +45,25 @@ import Data.Semigroup (Endo(..))
4545import Data.Semigroup (Semigroup(..))
4646#endif
4747import GHC.Exts (IsList(..), IsString(..))
48−import Text.Read (Lexeme(Ident), lexP, parens, prec, readPrec, readListPrec,
49− readListPrecDefault)
50−import Prelude hiding (map, repeat, zipWith, errorWithoutStackTrace)
51−
48+import Text.Read
49+ ( Lexeme(Ident), lexP, parens, prec, readPrec, readListPrec
50+ , readListPrecDefault)
5251import Streamly.Internal.BaseCompat ((#.), errorWithoutStackTrace)
5352import Streamly.Internal.Data.Stream.StreamK (IsStream(..), Stream)
54−import Streamly.Internal.Data.Strict (Maybe'(..), toMaybe)
53+import Streamly.Internal.Data.Maybe.Strict (Maybe'(..), toMaybe)
5554import Streamly.Internal.Data.SVar (MonadAsync)
5655
5756import qualified Streamly.Internal.Data.Stream.Prelude as P
5857import qualified Streamly.Internal.Data.Stream.StreamK as K
5958import qualified Streamly.Internal.Data.Stream.StreamD as D
60−
6159#ifdef USE_STREAMK_ONLY
6260import qualified Streamly.Internal.Data.Stream.StreamK as S
6361#else
6462import qualified Streamly.Internal.Data.Stream.StreamD as S
6563#endif
6664
65+import Prelude hiding (map, repeat, zipWith, errorWithoutStackTrace)
66+
6767#include "Instances.hs"
6868
6969-- | Like 'zipWith' but using a monadic zipping function.
src/Streamly/Internal/Data/Strict.hsdeleted−59
@@ -1,59 +0,0 @@
1−-- |
2−-- Module : Streamly.Internal.Data.Strict
3−-- Copyright : (c) 2019 Composewell Technologies
4−-- (c) 2013 Gabriel Gonzalez
5−-- License : BSD3
6−-- Maintainer : streamly@composewell.com
7−-- Stability : experimental
8−-- Portability : GHC
9−--
10−-- | Strict data types to be used as accumulator for strict left folds and
11−-- scans. For more comprehensive strict data types see
12−-- https://hackage.haskell.org/package/strict-base-types . The names have been
13−-- suffixed by a prime so that programmers can easily distinguish the strict
14−-- versions from the lazy ones.
15−--
16−-- One major advantage of strict data structures as accumulators in folds and
17−-- scans is that it helps the compiler optimize the code much better by
18−-- unboxing. In a big tight loop the difference could be huge.
19−--
20−module Streamly.Internal.Data.Strict
21− (
22− Tuple' (..)
23− , Tuple3' (..)
24− , Tuple4' (..)
25− , Maybe' (..)
26− , toMaybe
27− , Either' (..)
28− )
29−where
30−
31−-------------------------------------------------------------------------------
32−-- Tuples
33−-------------------------------------------------------------------------------
34−--
35−data Tuple' a b = Tuple' !a !b deriving Show
36−data Tuple3' a b c = Tuple3' !a !b !c deriving Show
37−data Tuple4' a b c d = Tuple4' !a !b !c !d deriving Show
38−
39−-------------------------------------------------------------------------------
40−-- Maybe
41−-------------------------------------------------------------------------------
42−--
43−-- | A strict 'Maybe'
44−data Maybe' a = Just' !a | Nothing' deriving Show
45−
46−-- XXX perhaps we can use a type class having fromStrict/toStrict operations.
47−--
48−-- | Convert strict Maybe' to lazy Maybe
49−{-# INLINABLE toMaybe #-}
50−toMaybe :: Maybe' a -> Maybe a
51−toMaybe Nothing' = Nothing
52−toMaybe (Just' a) = Just a
53−
54−-------------------------------------------------------------------------------
55−-- Either
56−-------------------------------------------------------------------------------
57−--
58−-- | A strict 'Either'
59−data Either' a b = Left' !a | Right' !b deriving Show
src/Streamly/Internal/Data/Tuple/Strict.hsnew file+35
@@ -0,0 +1,35 @@
1+-- |
2+-- Module : Streamly.Internal.Data.Tuple.Strict
3+-- Copyright : (c) 2019 Composewell Technologies
4+-- (c) 2013 Gabriel Gonzalez
5+-- License : BSD3
6+-- Maintainer : streamly@composewell.com
7+-- Stability : experimental
8+-- Portability : GHC
9+--
10+-- | Strict data types to be used as accumulator for strict left folds and
11+-- scans. For more comprehensive strict data types see
12+-- https://hackage.haskell.org/package/strict-base-types . The names have been
13+-- suffixed by a prime so that programmers can easily distinguish the strict
14+-- versions from the lazy ones.
15+--
16+-- One major advantage of strict data structures as accumulators in folds and
17+-- scans is that it helps the compiler optimize the code much better by
18+-- unboxing. In a big tight loop the difference could be huge.
19+--
20+module Streamly.Internal.Data.Tuple.Strict
21+ (
22+ Tuple' (..)
23+ , Tuple3' (..)
24+ , Tuple4' (..)
25+ )
26+where
27+
28+-- | A strict '(,)'
29+data Tuple' a b = Tuple' !a !b deriving Show
30+
31+-- | A strict '(,,)'
32+data Tuple3' a b c = Tuple3' !a !b !c deriving Show
33+
34+-- | A strict '(,,,)'
35+data Tuple4' a b c d = Tuple4' !a !b !c !d deriving Show
src/Streamly/Internal/Data/Unicode/Stream.hs+3−3
@@ -64,21 +64,21 @@ import GHC.Base (assert, unsafeChr)
6464import GHC.ForeignPtr (ForeignPtr (..))
6565import GHC.IO.Encoding.Failure (isSurrogate)
6666import GHC.Ptr (Ptr (..), plusPtr)
67−import Prelude hiding (String, lines, words, unlines, unwords)
6867import System.IO.Unsafe (unsafePerformIO)
69−
7068import Streamly (IsStream)
7169import Streamly.Data.Fold (Fold)
7270import Streamly.Memory.Array (Array)
7371import Streamly.Internal.Data.Unfold (Unfold)
7472import Streamly.Internal.Data.SVar (adaptState)
7573import Streamly.Internal.Data.Stream.StreamD (Stream(..), Step (..))
76−import Streamly.Internal.Data.Strict (Tuple'(..))
74+import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
7775
7876import qualified Streamly.Internal.Memory.Array.Types as A
7977import qualified Streamly.Internal.Prelude as S
8078import qualified Streamly.Internal.Data.Stream.StreamD as D
8179
80+import Prelude hiding (String, lines, words, unlines, unwords)
81+
8282-------------------------------------------------------------------------------
8383-- Encoding/Decoding Unicode (UTF-8) Characters
8484-------------------------------------------------------------------------------
src/Streamly/Internal/Memory/Mutable/Array/Types.hs+10−13
@@ -94,6 +94,9 @@ import Control.DeepSeq (NFData(..))
9494import Control.Monad (when, void)
9595import Control.Monad.IO.Class (MonadIO(..))
9696import Data.Functor.Identity (runIdentity)
97+#if __GLASGOW_HASKELL__ < 808
98+import Data.Semigroup (Semigroup(..))
99+#endif
97100import Data.Word (Word8)
98101import Foreign.C.Types (CSize(..), CInt(..))
99102import Foreign.ForeignPtr (withForeignPtr, touchForeignPtr)
@@ -105,11 +108,17 @@ import GHC.Exts (IsList, IsString(..))
105108import GHC.ForeignPtr (ForeignPtr(..))
106109import GHC.IO (IO(IO), unsafePerformIO)
107110import GHC.Ptr (Ptr(..))
111+#if !defined(mingw32_HOST_OS)
112+import Streamly.FileSystem.FDIO (IOVec(..))
113+#endif
108114import Streamly.Internal.Data.Fold.Types (Fold(..))
109−import Streamly.Internal.Data.Strict (Tuple'(..))
115+import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
110116import Streamly.Internal.Data.SVar (adaptState)
111117import Text.Read (readPrec, readListPrec, readListPrecDefault)
112118
119+#ifdef DEVBUILD
120+import qualified Data.Foldable as F
121+#endif
113122import qualified Streamly.Memory.Malloc as Malloc
114123import qualified Streamly.Internal.Data.Stream.StreamD.Type as D
115124import qualified Streamly.Internal.Data.Stream.StreamK as K
@@ -117,18 +126,6 @@ import qualified GHC.Exts as Exts
117126
118127import Prelude hiding (length, foldr, read, unlines, splitAt)
119128
120−#if __GLASGOW_HASKELL__ < 808
121−import Data.Semigroup (Semigroup(..))
122−#endif
123−
124−#if !defined(mingw32_HOST_OS)
125−import Streamly.FileSystem.FDIO (IOVec(..))
126−#endif
127−
128−#ifdef DEVBUILD
129−import qualified Data.Foldable as F
130−#endif
131−
132129#if MIN_VERSION_base(4,10,0)
133130import Foreign.ForeignPtr (plusForeignPtr)
134131#else
src/Streamly/Internal/Prelude.hs+21−26
@@ -535,25 +535,12 @@ import Data.Heap (Entry(..))
535535import Data.Maybe (isJust, fromJust, isNothing)
536536import Data.Void (Void)
537537import Foreign.Storable (Storable)
538−import Prelude
539− hiding (filter, drop, dropWhile, take, takeWhile, zipWith, foldr,
540− foldl, map, mapM, mapM_, sequence, all, any, sum, product, elem,
541− notElem, maximum, minimum, head, last, tail, length, null,
542− reverse, iterate, init, and, or, lookup, foldr1, (!!),
543− scanl, scanl1, replicate, concatMap, span, splitAt, break,
544− repeat, concat, mconcat)
545−
546−import qualified Data.Heap as H
547−import qualified Data.Map.Strict as Map
548−import qualified Prelude
549−import qualified System.IO as IO
550−
551−import Streamly.Internal.Data.Stream.Enumeration (Enumerable(..), enumerate, enumerateTo)
538+import Streamly.Internal.Data.Stream.Enumeration
539+ (Enumerable(..), enumerate, enumerateTo)
552540import Streamly.Internal.Data.Fold.Types (Fold (..), Fold2 (..))
553541import Streamly.Internal.Data.Parser (Parser (..))
554542import Streamly.Internal.Data.Unfold.Types (Unfold)
555543import Streamly.Internal.Memory.Array.Types (Array, writeNUnsafe)
556−-- import Streamly.Memory.Ring (Ring)
557544import Streamly.Internal.Data.SVar (MonadAsync, defState, Rate)
558545import Streamly.Internal.Data.Stream.Combinators (inspectMode, maxYields)
559546import Streamly.Internal.Data.Stream.Prelude
@@ -564,11 +551,10 @@ import Streamly.Internal.Data.Stream.Serial (SerialT, WSerialT)
564551import Streamly.Internal.Data.Stream.Zip (ZipSerialM)
565552import Streamly.Internal.Data.Pipe.Types (Pipe (..))
566553import Streamly.Internal.Data.Time.Units
567− (AbsTime, MilliSecond64(..), addToAbsTime, toRelTime,
568− toAbsTime, TimeUnit64, RelTime64, addToAbsTime64)
554+ ( AbsTime, MilliSecond64(..), addToAbsTime, toRelTime
555+ , toAbsTime, TimeUnit64, RelTime64, addToAbsTime64)
569556import Streamly.Internal.Mutable.Prim.Var (Prim, Var)
570−
571−import Streamly.Internal.Data.Strict
557+import Streamly.Internal.Data.Tuple.Strict (Tuple'(..))
572558
573559import qualified Streamly.Internal.Memory.Array as A
574560import qualified Streamly.Data.Fold as FL
@@ -576,19 +562,28 @@ import qualified Streamly.Internal.Data.Fold.Types as FL
576562import qualified Streamly.Internal.Data.Stream.Prelude as P
577563import qualified Streamly.Internal.Data.Stream.StreamK as K
578564import qualified Streamly.Internal.Data.Stream.StreamD as D
579−
565+import qualified Streamly.Internal.Data.Stream.Serial as Serial
566+import qualified Streamly.Internal.Data.Stream.Parallel as Par
567+import qualified Streamly.Internal.Data.Stream.Zip as Z
568+import qualified Streamly.Internal.Data.Parser.ParserK.Types as PRK
569+import qualified Streamly.Internal.Data.Parser.ParserD as PRD
570+import qualified Data.Heap as H
571+import qualified Data.Map.Strict as Map
572+import qualified Prelude
573+import qualified System.IO as IO
580574#ifdef USE_STREAMK_ONLY
581575import qualified Streamly.Internal.Data.Stream.StreamK as S
582576#else
583577import qualified Streamly.Internal.Data.Stream.StreamD as S
584578#endif
585579
586−-- import qualified Streamly.Internal.Data.Stream.Async as Async
587−import qualified Streamly.Internal.Data.Stream.Serial as Serial
588−import qualified Streamly.Internal.Data.Stream.Parallel as Par
589−import qualified Streamly.Internal.Data.Stream.Zip as Z
590−import qualified Streamly.Internal.Data.Parser.ParserK.Types as PRK
591−import qualified Streamly.Internal.Data.Parser.ParserD as PRD
580+import Prelude hiding
581+ ( filter, drop, dropWhile, take, takeWhile, zipWith, foldr
582+ , foldl, map, mapM, mapM_, sequence, all, any, sum, product, elem
583+ , notElem, maximum, minimum, head, last, tail, length, null
584+ , reverse, iterate, init, and, or, lookup, foldr1, (!!)
585+ , scanl, scanl1, replicate, concatMap, span, splitAt, break
586+ , repeat, concat, mconcat)
592587
593588------------------------------------------------------------------------------
594589-- Deconstruction
streamly.cabal+3−1
@@ -375,7 +375,9 @@ library
375375 -- Internal modules
376376 , Streamly.Internal.BaseCompat
377377 , Streamly.Internal.Control.Monad
378− , Streamly.Internal.Data.Strict
378+ , Streamly.Internal.Data.Tuple.Strict
379+ , Streamly.Internal.Data.Maybe.Strict
380+ , Streamly.Internal.Data.Either.Strict
379381 , Streamly.Internal.Data.Atomics
380382 , Streamly.Internal.Data.Time
381383 , Streamly.Internal.Data.Time.TimeSpec