on master help sign in
Deprecate Streamly.Prelude & S.Internal.Data.Stream.IsStream.*
5327f18Adithya Kumar
benchmark/NanoBenchmarks.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-------------------------------------------------------------------------------
3-------------------------------------------------------------------------------
2-- Investigate specific benchmarks more closely in isolation, possibly looking
4-- Investigate specific benchmarks more closely in isolation, possibly looking
3-- at GHC generated code for optimizing specific problematic cases.
5-- at GHC generated code for optimizing specific problematic cases.
benchmark/Streamly/Benchmark/Data/Array.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1{-# LANGUAGE CPP #-}
3{-# LANGUAGE CPP #-}
2
4
3#include "Streamly/Benchmark/Data/Array/CommonImports.hs"
5#include "Streamly/Benchmark/Data/Array/CommonImports.hs"
benchmark/Streamly/Benchmark/Data/Array/SmallArray.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1{-# LANGUAGE CPP #-}
3{-# LANGUAGE CPP #-}
2
4
3#include "Streamly/Benchmark/Data/Array/CommonImports.hs"
5#include "Streamly/Benchmark/Data/Array/CommonImports.hs"
benchmark/Streamly/Benchmark/Data/Array/Stream/Unboxed.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Benchmark.Data.ParserD
4-- Module : Streamly.Benchmark.Data.ParserD
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
benchmark/Streamly/Benchmark/Data/Array/Unboxed.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1{-# LANGUAGE CPP #-}
3{-# LANGUAGE CPP #-}
2
4
3#include "Streamly/Benchmark/Data/Array/CommonImports.hs"
5#include "Streamly/Benchmark/Data/Array/CommonImports.hs"
benchmark/Streamly/Benchmark/Data/Array/Unboxed/Mut.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Benchmark.Data.Array.Unboxed.Mut
4-- Module : Streamly.Benchmark.Data.Array.Unboxed.Mut
3-- Copyright : (c) 2021 Composewell Technologies
5-- Copyright : (c) 2021 Composewell Technologies
benchmark/Streamly/Benchmark/Data/Fold/Window.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1module Main (main) where
3module Main (main) where
2
4
3import Control.DeepSeq (NFData)
5import Control.DeepSeq (NFData)
benchmark/Streamly/Benchmark/Data/Parser.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Benchmark.Data.Parser
4-- Module : Streamly.Benchmark.Data.Parser
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
benchmark/Streamly/Benchmark/Data/Parser/ParserD.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Benchmark.Data.ParserD
4-- Module : Streamly.Benchmark.Data.ParserD
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
benchmark/Streamly/Benchmark/Data/Stream/Common.hs+4
@@ -9,6 +9,10 @@
9-- License : BSD-3-Clause
9-- License : BSD-3-Clause
10-- Maintainer : streamly@composewell.com
10-- Maintainer : streamly@composewell.com
11
11
12+#ifdef USE_PRELUDE
13+{-# OPTIONS_GHC -Wno-deprecations #-}
14+#endif
15+
12module Stream.Common
16module Stream.Common
13 ( MonadAsync
17 ( MonadAsync
14
18
benchmark/Streamly/Benchmark/Data/Stream/Eliminate.hs+4
@@ -9,6 +9,10 @@
9{-# LANGUAGE ScopedTypeVariables #-}
9{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE RankNTypes #-}
10{-# LANGUAGE RankNTypes #-}
11
11
12+#ifdef USE_PRELUDE
13+{-# OPTIONS_GHC -Wno-deprecations #-}
14+#endif
15+
12#ifdef __HADDOCK_VERSION__
16#ifdef __HADDOCK_VERSION__
13#undef INSPECTION
17#undef INSPECTION
14#endif
18#endif
benchmark/Streamly/Benchmark/Data/Stream/Exceptions.hs+4
@@ -10,6 +10,10 @@
10{-# LANGUAGE FlexibleContexts #-}
10{-# LANGUAGE FlexibleContexts #-}
11{-# LANGUAGE ScopedTypeVariables #-}
11{-# LANGUAGE ScopedTypeVariables #-}
12
12
13+#ifdef USE_PRELUDE
14+{-# OPTIONS_GHC -Wno-deprecations #-}
15+#endif
16+
13#ifdef __HADDOCK_VERSION__
17#ifdef __HADDOCK_VERSION__
14#undef INSPECTION
18#undef INSPECTION
15#endif
19#endif
benchmark/Streamly/Benchmark/Data/Stream/Expand.hs+4
@@ -10,6 +10,10 @@
10{-# LANGUAGE RankNTypes #-}
10{-# LANGUAGE RankNTypes #-}
11{-# LANGUAGE TupleSections #-}
11{-# LANGUAGE TupleSections #-}
12
12
13+#ifdef USE_PRELUDE
14+{-# OPTIONS_GHC -Wno-deprecations #-}
15+#endif
16+
13#ifdef __HADDOCK_VERSION__
17#ifdef __HADDOCK_VERSION__
14#undef INSPECTION
18#undef INSPECTION
15#endif
19#endif
benchmark/Streamly/Benchmark/Data/Stream/Generate.hs+4
@@ -9,6 +9,10 @@
9{-# LANGUAGE ScopedTypeVariables #-}
9{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE RankNTypes #-}
10{-# LANGUAGE RankNTypes #-}
11
11
12+#ifdef USE_PRELUDE
13+{-# OPTIONS_GHC -Wno-deprecations #-}
14+#endif
15+
12module Stream.Generate (benchmarks) where
16module Stream.Generate (benchmarks) where
13
17
14import Data.Functor.Identity (Identity)
18import Data.Functor.Identity (Identity)
benchmark/Streamly/Benchmark/Data/Stream/Lift.hs+4
@@ -9,6 +9,10 @@
9{-# LANGUAGE ScopedTypeVariables #-}
9{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE RankNTypes #-}
10{-# LANGUAGE RankNTypes #-}
11
11
12+#ifdef USE_PRELUDE
13+{-# OPTIONS_GHC -Wno-deprecations #-}
14+#endif
15+
12module Stream.Lift (benchmarks) where
16module Stream.Lift (benchmarks) where
13
17
14import Control.DeepSeq (NFData(..))
18import Control.DeepSeq (NFData(..))
benchmark/Streamly/Benchmark/Data/Stream/Reduce.hs+4
@@ -11,6 +11,10 @@
11{-# LANGUAGE DeriveGeneric #-}
11{-# LANGUAGE DeriveGeneric #-}
12{-# LANGUAGE RankNTypes #-}
12{-# LANGUAGE RankNTypes #-}
13
13
14+#ifdef USE_PRELUDE
15+{-# OPTIONS_GHC -Wno-deprecations #-}
16+#endif
17+
14module Stream.Reduce (benchmarks) where
18module Stream.Reduce (benchmarks) where
15
19
16import Control.DeepSeq (NFData(..))
20import Control.DeepSeq (NFData(..))
benchmark/Streamly/Benchmark/Data/Stream/Split.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Stream.Split
4-- Module : Stream.Split
3-- Copyright : (c) 2019 Composewell Technologies
5-- Copyright : (c) 2019 Composewell Technologies
benchmark/Streamly/Benchmark/Data/Stream/StreamDK.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Benchmark.Data.Stream.StreamDK
4-- Module : Streamly.Benchmark.Data.Stream.StreamDK
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Data/Stream/Transform.hs+4
@@ -9,6 +9,10 @@
9{-# LANGUAGE ScopedTypeVariables #-}
9{-# LANGUAGE ScopedTypeVariables #-}
10{-# LANGUAGE RankNTypes #-}
10{-# LANGUAGE RankNTypes #-}
11
11
12+#ifdef USE_PRELUDE
13+{-# OPTIONS_GHC -Wno-deprecations #-}
14+#endif
15+
12#ifdef __HADDOCK_VERSION__
16#ifdef __HADDOCK_VERSION__
13#undef INSPECTION
17#undef INSPECTION
14#endif
18#endif
benchmark/Streamly/Benchmark/FileSystem/Handle/Read.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Benchmark.FileSystem.Handle
4-- Module : Streamly.Benchmark.FileSystem.Handle
3-- Copyright : (c) 2019 Composewell Technologies
5-- Copyright : (c) 2019 Composewell Technologies
benchmark/Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Benchmark.FileSystem.Handle
4-- Module : Streamly.Benchmark.FileSystem.Handle
3-- Copyright : (c) 2019 Composewell Technologies
5-- Copyright : (c) 2019 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/Adaptive.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Main
4-- Module : Main
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/Ahead.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Main
4-- Module : Main
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/Async.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Main
4-- Module : Main
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/Concurrent.hs+1
@@ -1,3 +1,4 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
1{-# LANGUAGE CPP #-}
2{-# LANGUAGE CPP #-}
2{-# LANGUAGE RankNTypes #-}
3{-# LANGUAGE RankNTypes #-}
3-- |
4-- |
benchmark/Streamly/Benchmark/Prelude/Merge.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Main
4-- Module : Main
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/Parallel.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Main
4-- Module : Main
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/Rate.hs+1
@@ -1,3 +1,4 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
1{-# LANGUAGE FlexibleContexts #-}
2{-# LANGUAGE FlexibleContexts #-}
2
3
3-- |
4-- |
benchmark/Streamly/Benchmark/Prelude/WAsync.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Main
4-- Module : Main
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/WSerial.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Main
4-- Module : Main
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/ZipAsync.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Main
4-- Module : Main
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/ZipSerial.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Main
4-- Module : Main
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Unicode/Char.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1--
3--
2-- Module : Streamly.Unicode.Char
4-- Module : Streamly.Unicode.Char
3-- Copyright : (c) 2021 Composewell Technologies
5-- Copyright : (c) 2021 Composewell Technologies
benchmark/Streamly/Benchmark/Unicode/Stream.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1--
3--
2-- Module : Streamly.Unicode.Stream
4-- Module : Streamly.Unicode.Stream
3-- Copyright : (c) 2019 Composewell Technologies
5-- Copyright : (c) 2019 Composewell Technologies
benchmark/lib/Streamly/Benchmark/Prelude.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Benchmark.Prelude
4-- Module : Streamly.Benchmark.Prelude
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
core/src/Streamly/Internal/FileSystem/Handle.hs+3−3
@@ -146,10 +146,10 @@ import qualified Streamly.Internal.Data.Stream.StreamK.Type as K (mkStream)
146-- >>> import qualified Streamly.Data.Array.Unboxed as Array
146-- >>> import qualified Streamly.Data.Array.Unboxed as Array
147-- >>> import qualified Streamly.Data.Fold as Fold
147-- >>> import qualified Streamly.Data.Fold as Fold
148-- >>> import qualified Streamly.Data.Unfold as Unfold
148-- >>> import qualified Streamly.Data.Unfold as Unfold
149−-- >>> import qualified Streamly.Prelude as Stream
149+-- >>> import qualified Streamly.Data.Stream as Stream
150--
150--
151-- >>> import qualified Streamly.Internal.Data.Array.Unboxed.Type as Array (writeNUnsafe)
151-- >>> import qualified Streamly.Internal.Data.Array.Unboxed.Type as Array (writeNUnsafe)
152−-- >>> import qualified Streamly.Internal.Data.Stream.IsStream as Stream
152+-- >>> import qualified Streamly.Internal.Data.Stream as Stream
153-- >>> import qualified Streamly.Internal.Data.Unfold as Unfold (first)
153-- >>> import qualified Streamly.Internal.Data.Unfold as Unfold (first)
154-- >>> import qualified Streamly.Internal.FileSystem.Handle as Handle
154-- >>> import qualified Streamly.Internal.FileSystem.Handle as Handle
155-- >>> import qualified Streamly.Internal.System.IO as IO (defaultChunkSize)
155-- >>> import qualified Streamly.Internal.System.IO as IO (defaultChunkSize)
@@ -410,7 +410,7 @@ putChunk h arr = A.asPtrUnsafe arr $ \ptr ->
410-- XXX use an unfold to fromObjects or fromUnfold so that we can put any object
410-- XXX use an unfold to fromObjects or fromUnfold so that we can put any object
411-- | Write a stream of arrays to a handle.
411-- | Write a stream of arrays to a handle.
412--
412--
413−-- >>> putChunks h = Stream.mapM_ (Handle.putChunk h)
413+-- >>> putChunks h = Stream.fold (Fold.drainBy (Handle.putChunk h))
414--
414--
415-- @since 0.7.0
415-- @since 0.7.0
416{-# INLINE putChunks #-}
416{-# INLINE putChunks #-}
core/src/Streamly/Internal/Unicode/Array/Char.hs+6−5
@@ -30,7 +30,8 @@ import Prelude hiding (String, lines, words, unlines, unwords)
30-- >>> :m
30-- >>> :m
31-- >>> :set -XOverloadedStrings
31-- >>> :set -XOverloadedStrings
32-- >>> import Prelude hiding (String, lines, words, unlines, unwords)
32-- >>> import Prelude hiding (String, lines, words, unlines, unwords)
33−-- >>> import qualified Streamly.Prelude as Stream
33+-- >>> import qualified Streamly.Data.Stream as Stream
34+-- >>> import qualified Streamly.Data.Fold as Fold
34-- >>> import qualified Streamly.Internal.Unicode.Array.Char as Unicode
35-- >>> import qualified Streamly.Internal.Unicode.Array.Char as Unicode
35
36
36-- | Break a string up into a stream of strings at newline characters.
37-- | Break a string up into a stream of strings at newline characters.
@@ -38,7 +39,7 @@ import Prelude hiding (String, lines, words, unlines, unwords)
38--
39--
39-- > lines = S.lines A.write
40-- > lines = S.lines A.write
40--
41--
41−-- >>> Stream.toList $ Unicode.lines $ Stream.fromList "lines\nthis\nstring\n\n\n"
42+-- >>> Stream.fold Fold.toList $ Unicode.lines $ Stream.fromList "lines\nthis\nstring\n\n\n"
42-- ["lines","this","string","",""]
43-- ["lines","this","string","",""]
43--
44--
44{-# INLINE lines #-}
45{-# INLINE lines #-}
@@ -50,7 +51,7 @@ lines = S.lines A.write
50--
51--
51-- > words = S.words A.write
52-- > words = S.words A.write
52--
53--
53−-- >>> Stream.toList $ Unicode.words $ Stream.fromList "A newline\nis considered white space?"
54+-- >>> Stream.fold Fold.toList $ Unicode.words $ Stream.fromList "A newline\nis considered white space?"
54-- ["A","newline","is","considered","white","space?"]
55-- ["A","newline","is","considered","white","space?"]
55--
56--
56{-# INLINE words #-}
57{-# INLINE words #-}
@@ -62,7 +63,7 @@ words = S.words A.write
62--
63--
63-- 'unlines' is an inverse operation to 'lines'.
64-- 'unlines' is an inverse operation to 'lines'.
64--
65--
65−-- >>> Stream.toList $ Unicode.unlines $ Stream.fromList ["lines", "this", "string"]
66+-- >>> Stream.fold Fold.toList $ Unicode.unlines $ Stream.fromList ["lines", "this", "string"]
66-- "lines\nthis\nstring\n"
67-- "lines\nthis\nstring\n"
67--
68--
68-- > unlines = S.unlines A.read
69-- > unlines = S.unlines A.read
@@ -79,7 +80,7 @@ unlines = S.unlines A.reader
79--
80--
80-- 'unwords' is an inverse operation to 'words'.
81-- 'unwords' is an inverse operation to 'words'.
81--
82--
82−-- >>> Stream.toList $ Unicode.unwords $ Stream.fromList ["unwords", "this", "string"]
83+-- >>> Stream.fold Fold.toList $ Unicode.unwords $ Stream.fromList ["unwords", "this", "string"]
83-- "unwords this string"
84-- "unwords this string"
84--
85--
85-- > unwords = S.unwords A.read
86-- > unwords = S.unwords A.read
core/src/Streamly/Internal/Unicode/Stream.hs+3−3
@@ -128,7 +128,7 @@ import Prelude hiding (lines, words, unlines, unwords)
128-- >>> :m
128-- >>> :m
129-- >>> :set -XMagicHash
129-- >>> :set -XMagicHash
130-- >>> import Prelude hiding (lines, words, unlines, unwords)
130-- >>> import Prelude hiding (lines, words, unlines, unwords)
131−-- >>> import qualified Streamly.Prelude as Stream
131+-- >>> import qualified Streamly.Data.Stream as Stream
132-- >>> import qualified Streamly.Data.Fold as Fold
132-- >>> import qualified Streamly.Data.Fold as Fold
133-- >>> import qualified Streamly.Internal.Unicode.Stream as Unicode
133-- >>> import qualified Streamly.Internal.Unicode.Stream as Unicode
134-- >>> import Streamly.Internal.Unicode.Stream
134-- >>> import Streamly.Internal.Unicode.Stream
@@ -1066,7 +1066,7 @@ stripHead = Stream.dropWhile isSpace
1066-- | Fold each line of the stream using the supplied 'Fold'
1066-- | Fold each line of the stream using the supplied 'Fold'
1067-- and stream the result.
1067-- and stream the result.
1068--
1068--
1069−-- >>> Stream.toList $ lines Fold.toList (Stream.fromList "lines\nthis\nstring\n\n\n")
1069+-- >>> Stream.fold Fold.toList $ lines Fold.toList (Stream.fromList "lines\nthis\nstring\n\n\n")
1070-- ["lines","this","string","",""]
1070-- ["lines","this","string","",""]
1071--
1071--
1072-- > lines = Stream.splitOnSuffix (== '\n')
1072-- > lines = Stream.splitOnSuffix (== '\n')
@@ -1097,7 +1097,7 @@ isSpace c
1097-- | Fold each word of the stream using the supplied 'Fold'
1097-- | Fold each word of the stream using the supplied 'Fold'
1098-- and stream the result.
1098-- and stream the result.
1099--
1099--
1100−-- >>> Stream.toList $ words Fold.toList (Stream.fromList "fold these words")
1100+-- >>> Stream.fold Fold.toList $ words Fold.toList (Stream.fromList "fold these words")
1101-- ["fold","these","words"]
1101-- ["fold","these","words"]
1102--
1102--
1103-- > words = Stream.wordsBy isSpace
1103-- > words = Stream.wordsBy isSpace
docs/User/Tutorials/ConcurrentStreams.hs+4−1
@@ -87,7 +87,7 @@ module User.Tutorials.ConcurrentStreams
87 )
87 )
88where
88where
89
89
90−import Streamly.Prelude
90+import Streamly.Data.Stream
91import Data.Semigroup
91import Data.Semigroup
92import Control.Applicative
92import Control.Applicative
93import Control.Monad
93import Control.Monad
@@ -96,8 +96,11 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
96
96
97-- CAUTION: please keep setup and imports sections in sync
97-- CAUTION: please keep setup and imports sections in sync
98
98
99+-- XXX This tutorial has to be rewritten.
100+
99-- $setup
101-- $setup
100-- >>> :m
102-- >>> :m
103+-- >>> :set -fno-warn-deprecations
101-- >>> import Data.Function ((&))
104-- >>> import Data.Function ((&))
102-- >>> import Streamly.Prelude ((|:), (|&))
105-- >>> import Streamly.Prelude ((|:), (|&))
103-- >>> import qualified Streamly.Prelude as Stream
106-- >>> import qualified Streamly.Prelude as Stream
docs/User/Tutorials/ReactiveProgramming.hs+1−1
@@ -20,7 +20,7 @@ module User.Tutorials.ReactiveProgramming
20 )
20 )
21where
21where
22
22
23−import Streamly.Prelude
23+import Streamly.Data.Stream
24import Data.Semigroup
24import Data.Semigroup
25import Control.Applicative
25import Control.Applicative
26import Control.Monad
26import Control.Monad
docs/User/Tutorials/Tutorial.hs+4−1
@@ -74,7 +74,7 @@ module User.Tutorials.Tutorial
74 )
74 )
75where
75where
76
76
77−import Streamly.Prelude
77+import Streamly.Data.Stream
78import Data.Semigroup
78import Data.Semigroup
79import Control.Applicative
79import Control.Applicative
80import Control.Monad
80import Control.Monad
@@ -83,8 +83,11 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
83
83
84-- CAUTION: please keep setup and imports sections in sync
84-- CAUTION: please keep setup and imports sections in sync
85
85
86+-- XXX This tutorial has to be re-written.
87+
86-- $setup
88-- $setup
87-- >>> :m
89-- >>> :m
90+-- >>> :set -fno-warn-deprecations
88-- >>> import Data.Function ((&))
91-- >>> import Data.Function ((&))
89-- >>> import Streamly.Prelude ((|:), (|&))
92-- >>> import Streamly.Prelude ((|:), (|&))
90-- >>> import qualified Streamly.Prelude as Stream
93-- >>> import qualified Streamly.Prelude as Stream
src/Streamly.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly
4-- Module : Streamly
3-- Copyright : (c) 2017 Composewell Technologies
5-- Copyright : (c) 2017 Composewell Technologies
src/Streamly/Data/Array/Foreign.hs+1
@@ -97,6 +97,7 @@ import Streamly.Internal.Data.Array.Unboxed as A
97
97
98-- $setup
98-- $setup
99-- >>> :m
99-- >>> :m
100+-- >>> :set -fno-warn-deprecations
100-- >>> :set -XFlexibleContexts
101-- >>> :set -XFlexibleContexts
101-- >>> :set -package streamly
102-- >>> :set -package streamly
102-- >>> import Streamly.Internal.Data.Stream (Stream)
103-- >>> import Streamly.Internal.Data.Stream (Stream)
src/Streamly/Internal/Data/Fold/Async.hs+1
@@ -28,6 +28,7 @@ import Streamly.Internal.Data.Tuple.Strict (Tuple3'(..))
28
28
29-- $setup
29-- $setup
30-- >>> :m
30-- >>> :m
31+-- >>> :set -fno-warn-deprecations
31-- >>> :set -XFlexibleContexts
32-- >>> :set -XFlexibleContexts
32-- >>> import qualified Streamly.Prelude as Stream
33-- >>> import qualified Streamly.Prelude as Stream
33-- >>> import qualified Streamly.Data.Fold as Fold
34-- >>> import qualified Streamly.Data.Fold as Fold
src/Streamly/Internal/Data/Stream/Ahead.hs+1
@@ -64,6 +64,7 @@ import Prelude hiding (map)
64#include "Instances.hs"
64#include "Instances.hs"
65
65
66-- $setup
66-- $setup
67+-- >>> :set -fno-warn-deprecations
67-- >>> import qualified Streamly.Prelude as Stream
68-- >>> import qualified Streamly.Prelude as Stream
68-- >>> import Control.Concurrent (threadDelay)
69-- >>> import Control.Concurrent (threadDelay)
69-- >>> :{
70-- >>> :{
src/Streamly/Internal/Data/Stream/Async.hs+1
@@ -73,6 +73,7 @@ import Streamly.Internal.Data.SVar
73#include "Instances.hs"
73#include "Instances.hs"
74
74
75-- $setup
75-- $setup
76+-- >>> :set -fno-warn-deprecations
76-- >>> import qualified Streamly.Prelude as Stream
77-- >>> import qualified Streamly.Prelude as Stream
77-- >>> import Control.Concurrent (threadDelay)
78-- >>> import Control.Concurrent (threadDelay)
78-- >>> :{
79-- >>> :{
src/Streamly/Internal/Data/Stream/IsStream.hs+3−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Internal.Data.Stream.IsStream
4-- Module : Streamly.Internal.Data.Stream.IsStream
3-- Copyright : (c) 2017 Composewell Technologies
5-- Copyright : (c) 2017 Composewell Technologies
@@ -10,7 +12,7 @@
10-- module "Streamly.Prelude". It contains some additional unreleased or
12-- module "Streamly.Prelude". It contains some additional unreleased or
11-- experimental APIs.
13-- experimental APIs.
12
14
13−module Streamly.Internal.Data.Stream.IsStream
15+module Streamly.Internal.Data.Stream.IsStream {-# DEPRECATED "Please use \"Streamly.Data.Stream\", \"Streamly.Data.Stream.Concurrent\", & \"Streamly.Data.Stream.Time\" instead." #-}
14 ( module Streamly.Internal.Data.Stream.IsStream.Type
16 ( module Streamly.Internal.Data.Stream.IsStream.Type
15 , module Streamly.Internal.Data.Stream.IsStream.Generate
17 , module Streamly.Internal.Data.Stream.IsStream.Generate
16 , module Streamly.Internal.Data.Stream.IsStream.Eliminate
18 , module Streamly.Internal.Data.Stream.IsStream.Eliminate
src/Streamly/Internal/Data/Stream/IsStream/Combinators.hs+3−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Internal.Data.Stream.Combinators
4-- Module : Streamly.Internal.Data.Stream.Combinators
3-- Copyright : (c) 2017 Composewell Technologies
5-- Copyright : (c) 2017 Composewell Technologies
@@ -7,7 +9,7 @@
7-- Portability : GHC
9-- Portability : GHC
8--
10--
9--
11--
10−module Streamly.Internal.Data.Stream.IsStream.Combinators
12+module Streamly.Internal.Data.Stream.IsStream.Combinators {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
11 ( maxThreads
13 ( maxThreads
12 , maxBuffer
14 , maxBuffer
13 , maxYields
15 , maxYields
src/Streamly/Internal/Data/Stream/IsStream/Common.hs+3−1
@@ -1,3 +1,4 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
1{-# OPTIONS_GHC -Wno-orphans #-}
2{-# OPTIONS_GHC -Wno-orphans #-}
2
3
3-- |
4-- |
@@ -11,7 +12,7 @@
11-- Bottom level IsStream module that can be used by all other upper level
12-- Bottom level IsStream module that can be used by all other upper level
12-- IsStream modules.
13-- IsStream modules.
13
14
14−module Streamly.Internal.Data.Stream.IsStream.Common
15+module Streamly.Internal.Data.Stream.IsStream.Common {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
15 (
16 (
16 -- * Generation
17 -- * Generation
17 fromPure
18 fromPure
@@ -98,6 +99,7 @@ import Prelude hiding (take, takeWhile, drop, reverse, concatMap, map, zipWith)
98--
99--
99-- $setup
100-- $setup
100-- >>> :m
101-- >>> :m
102+-- >>> :set -fno-warn-deprecations
101-- >>> import Control.Concurrent (threadDelay)
103-- >>> import Control.Concurrent (threadDelay)
102-- >>> import Control.Monad (join)
104-- >>> import Control.Monad (join)
103-- >>> import Control.Monad.Trans.Class (lift)
105-- >>> import Control.Monad.Trans.Class (lift)
src/Streamly/Internal/Data/Stream/IsStream/Eliminate.hs+4−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Internal.Data.Stream.IsStream.Eliminate
4-- Module : Streamly.Internal.Data.Stream.IsStream.Eliminate
3-- Copyright : (c) 2017 Composewell Technologies
5-- Copyright : (c) 2017 Composewell Technologies
@@ -15,7 +17,7 @@
15-- We call them stream folding functions, they reduce a stream @t m a@ to a
17-- We call them stream folding functions, they reduce a stream @t m a@ to a
16-- monadic value @m b@.
18-- monadic value @m b@.
17
19
18−module Streamly.Internal.Data.Stream.IsStream.Eliminate
20+module Streamly.Internal.Data.Stream.IsStream.Eliminate {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
19 (
21 (
20 -- * Running Examples
22 -- * Running Examples
21 -- $setup
23 -- $setup
@@ -188,6 +190,7 @@ import Prelude hiding
188
190
189-- $setup
191-- $setup
190-- >>> :m
192-- >>> :m
193+-- >>> :set -fno-warn-deprecations
191-- >>> import Streamly.Prelude (SerialT)
194-- >>> import Streamly.Prelude (SerialT)
192-- >>> import qualified Streamly.Prelude as Stream
195-- >>> import qualified Streamly.Prelude as Stream
193-- >>> import qualified Streamly.Internal.Data.Stream.IsStream as Stream
196-- >>> import qualified Streamly.Internal.Data.Stream.IsStream as Stream
src/Streamly/Internal/Data/Stream/IsStream/Enumeration.hs+4−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Internal.Data.Stream.Enumeration
4-- Module : Streamly.Internal.Data.Stream.Enumeration
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
@@ -20,7 +22,7 @@
20-- in this module can be used to define them. Alternatively, these functions
22-- in this module can be used to define them. Alternatively, these functions
21-- can be used directly.
23-- can be used directly.
22
24
23−module Streamly.Internal.Data.Stream.IsStream.Enumeration
25+module Streamly.Internal.Data.Stream.IsStream.Enumeration {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
24 (
26 (
25 Enumerable (..)
27 Enumerable (..)
26
28
@@ -77,6 +79,7 @@ import qualified Streamly.Internal.Data.Stream.StreamD as D
77import qualified Streamly.Internal.Data.Stream.Serial as Serial (map)
79import qualified Streamly.Internal.Data.Stream.Serial as Serial (map)
78
80
79-- $setup
81-- $setup
82+-- >>> :set -fno-warn-deprecations
80-- >>> import Streamly.Prelude as Stream
83-- >>> import Streamly.Prelude as Stream
81-- >>> import Streamly.Internal.Data.Stream.IsStream.Enumeration as Stream
84-- >>> import Streamly.Internal.Data.Stream.IsStream.Enumeration as Stream
82
85
src/Streamly/Internal/Data/Stream/IsStream/Exception.hs+4−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Internal.Data.Stream.IsStream.Exception
4-- Module : Streamly.Internal.Data.Stream.IsStream.Exception
3-- Copyright : (c) 2019 Composewell Technologies
5-- Copyright : (c) 2019 Composewell Technologies
@@ -6,7 +8,7 @@
6-- Stability : experimental
8-- Stability : experimental
7-- Portability : GHC
9-- Portability : GHC
8
10
9−module Streamly.Internal.Data.Stream.IsStream.Exception
11+module Streamly.Internal.Data.Stream.IsStream.Exception {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
10 (
12 (
11 before
13 before
12 , after_
14 , after_
@@ -46,6 +48,7 @@ import qualified Streamly.Internal.Data.Stream.StreamD.Exception as D
46
48
47-- $setup
49-- $setup
48-- >>> :m
50-- >>> :m
51+-- >>> :set -fno-warn-deprecations
49-- >>> import qualified Streamly.Prelude as Stream
52-- >>> import qualified Streamly.Prelude as Stream
50-- >>> import qualified Streamly.Internal.Data.Stream.IsStream as Stream (nilM)
53-- >>> import qualified Streamly.Internal.Data.Stream.IsStream as Stream (nilM)
51
54
src/Streamly/Internal/Data/Stream/IsStream/Expand.hs+4−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Internal.Data.Stream.IsStream.Expand
4-- Module : Streamly.Internal.Data.Stream.IsStream.Expand
3-- Copyright : (c) 2017 Composewell Technologies
5-- Copyright : (c) 2017 Composewell Technologies
@@ -9,7 +11,7 @@
9-- Expand a stream by combining two or more streams or by combining streams
11-- Expand a stream by combining two or more streams or by combining streams
10-- with unfolds.
12-- with unfolds.
11
13
12−module Streamly.Internal.Data.Stream.IsStream.Expand
14+module Streamly.Internal.Data.Stream.IsStream.Expand {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
13 (
15 (
14 -- * Binary Combinators (Linear)
16 -- * Binary Combinators (Linear)
15 -- | Functions ending in the shape:
17 -- | Functions ending in the shape:
@@ -190,6 +192,7 @@ import Prelude hiding (concat, concatMap, zipWith)
190
192
191-- $setup
193-- $setup
192-- >>> :m
194-- >>> :m
195+-- >>> :set -fno-warn-deprecations
193-- >>> import Control.Concurrent (threadDelay)
196-- >>> import Control.Concurrent (threadDelay)
194-- >>> import Data.IORef
197-- >>> import Data.IORef
195-- >>> import Prelude hiding (zipWith, concatMap, concat)
198-- >>> import Prelude hiding (zipWith, concatMap, concat)
src/Streamly/Internal/Data/Stream/IsStream/Generate.hs+3−1
@@ -1,3 +1,4 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
1{-# OPTIONS_GHC -Wno-orphans #-}
2{-# OPTIONS_GHC -Wno-orphans #-}
2
3
3-- |
4-- |
@@ -15,7 +16,7 @@
15-- as StreamK when StreamK is used, avoiding conversion to StreamD. Will that
16-- as StreamK when StreamK is used, avoiding conversion to StreamD. Will that
16-- help? Are there any other reasons to keep these and not use unfolds?
17-- help? Are there any other reasons to keep these and not use unfolds?
17
18
18−module Streamly.Internal.Data.Stream.IsStream.Generate
19+module Streamly.Internal.Data.Stream.IsStream.Generate {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
19 (
20 (
20 -- * Primitives
21 -- * Primitives
21 IsStream.nil
22 IsStream.nil
@@ -124,6 +125,7 @@ import Prelude hiding (iterate, replicate, repeat)
124
125
125-- $setup
126-- $setup
126-- >>> :m
127-- >>> :m
128+-- >>> :set -fno-warn-deprecations
127-- >>> import Data.Function ((&))
129-- >>> import Data.Function ((&))
128-- >>> import Prelude hiding (iterate, replicate, repeat)
130-- >>> import Prelude hiding (iterate, replicate, repeat)
129-- >>> import qualified Streamly.Prelude as Stream
131-- >>> import qualified Streamly.Prelude as Stream
src/Streamly/Internal/Data/Stream/IsStream/Lift.hs+3−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Internal.Data.Stream.IsStream.Lift
4-- Module : Streamly.Internal.Data.Stream.IsStream.Lift
3-- Copyright : (c) 2019 Composewell Technologies
5-- Copyright : (c) 2019 Composewell Technologies
@@ -6,7 +8,7 @@
6-- Stability : experimental
8-- Stability : experimental
7-- Portability : GHC
9-- Portability : GHC
8
10
9−module Streamly.Internal.Data.Stream.IsStream.Lift
11+module Streamly.Internal.Data.Stream.IsStream.Lift {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
10 (
12 (
11 -- * Generalize Inner Monad
13 -- * Generalize Inner Monad
12 hoist
14 hoist
src/Streamly/Internal/Data/Stream/IsStream/Reduce.hs+4−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Internal.Data.Stream.IsStream.Reduce
4-- Module : Streamly.Internal.Data.Stream.IsStream.Reduce
3-- Copyright : (c) 2017 Composewell Technologies
5-- Copyright : (c) 2017 Composewell Technologies
@@ -8,7 +10,7 @@
8--
10--
9-- Reduce streams by streams, folds or parsers.
11-- Reduce streams by streams, folds or parsers.
10
12
11−module Streamly.Internal.Data.Stream.IsStream.Reduce
13+module Streamly.Internal.Data.Stream.IsStream.Reduce {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
12 (
14 (
13 -- * Reduce By Streams
15 -- * Reduce By Streams
14 dropPrefix
16 dropPrefix
@@ -211,6 +213,7 @@ import Prelude hiding (concatMap, map)
211
213
212-- $setup
214-- $setup
213-- >>> :m
215-- >>> :m
216+-- >>> :set -fno-warn-deprecations
214-- >>> import Prelude hiding (zipWith, concatMap, concat)
217-- >>> import Prelude hiding (zipWith, concatMap, concat)
215-- >>> import qualified Streamly.Prelude as Stream
218-- >>> import qualified Streamly.Prelude as Stream
216-- >>> import Streamly.Internal.Data.Stream.IsStream as Stream
219-- >>> import Streamly.Internal.Data.Stream.IsStream as Stream
src/Streamly/Internal/Data/Stream/IsStream/Top.hs+4−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Internal.Data.Stream.IsStream.Top
4-- Module : Streamly.Internal.Data.Stream.IsStream.Top
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
@@ -9,7 +11,7 @@
9-- Top level IsStream module that can use all other lower level IsStream
11-- Top level IsStream module that can use all other lower level IsStream
10-- modules.
12-- modules.
11
13
12−module Streamly.Internal.Data.Stream.IsStream.Top
14+module Streamly.Internal.Data.Stream.IsStream.Top {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
13 (
15 (
14 -- * Transformation
16 -- * Transformation
15 -- ** Sampling
17 -- ** Sampling
@@ -87,6 +89,7 @@ import Prelude hiding (filter, zipWith, concatMap, concat)
87
89
88-- $setup
90-- $setup
89-- >>> :m
91-- >>> :m
92+-- >>> :set -fno-warn-deprecations
90-- >>> import Prelude hiding (filter, zipWith, concatMap, concat)
93-- >>> import Prelude hiding (filter, zipWith, concatMap, concat)
91-- >>> import qualified Streamly.Prelude as Stream
94-- >>> import qualified Streamly.Prelude as Stream
92-- >>> import qualified Streamly.Internal.Data.Stream.IsStream as Stream
95-- >>> import qualified Streamly.Internal.Data.Stream.IsStream as Stream
src/Streamly/Internal/Data/Stream/IsStream/Transform.hs+4−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Internal.Data.Stream.IsStream.Transform
4-- Module : Streamly.Internal.Data.Stream.IsStream.Transform
3-- Copyright : (c) 2017 Composewell Technologies
5-- Copyright : (c) 2017 Composewell Technologies
@@ -6,7 +8,7 @@
6-- Stability : experimental
8-- Stability : experimental
7-- Portability : GHC
9-- Portability : GHC
8
10
9−module Streamly.Internal.Data.Stream.IsStream.Transform
11+module Streamly.Internal.Data.Stream.IsStream.Transform {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
10 (
12 (
11 -- * Piping
13 -- * Piping
12 -- | Pass through a 'Pipe'.
14 -- | Pass through a 'Pipe'.
@@ -272,6 +274,7 @@ import Prelude hiding
272--
274--
273-- $setup
275-- $setup
274-- >>> :m
276-- >>> :m
277+-- >>> :set -fno-warn-deprecations
275-- >>> import Control.Concurrent (threadDelay)
278-- >>> import Control.Concurrent (threadDelay)
276-- >>> import Data.Function ((&))
279-- >>> import Data.Function ((&))
277-- >>> import Streamly.Prelude ((|$))
280-- >>> import Streamly.Prelude ((|$))
src/Streamly/Internal/Data/Stream/IsStream/Type.hs+2−1
@@ -1,3 +1,4 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
1{-# LANGUAGE UndecidableInstances #-}
2{-# LANGUAGE UndecidableInstances #-}
2{-# OPTIONS_GHC -Wno-orphans #-}
3{-# OPTIONS_GHC -Wno-orphans #-}
3
4
@@ -10,7 +11,7 @@
10-- Portability : GHC
11-- Portability : GHC
11--
12--
12--
13--
13−module Streamly.Internal.Data.Stream.IsStream.Type
14+module Streamly.Internal.Data.Stream.IsStream.Type {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
14 (
15 (
15 -- * IsStream Type Class
16 -- * IsStream Type Class
16 IsStream (..)
17 IsStream (..)
src/Streamly/Internal/Data/Stream/Serial.hs+1
@@ -79,6 +79,7 @@ import Prelude hiding (map, mapM, repeat, filter)
79#include "inline.hs"
79#include "inline.hs"
80
80
81-- $setup
81-- $setup
82+-- >>> :set -fno-warn-deprecations
82-- >>> import qualified Streamly.Data.Stream as Stream
83-- >>> import qualified Streamly.Data.Stream as Stream
83-- >>> import qualified Streamly.Prelude as IsStream
84-- >>> import qualified Streamly.Prelude as IsStream
84
85
src/Streamly/Internal/Data/Stream/Zip/Concurrent.hs+2−1
@@ -9,7 +9,8 @@
9--
9--
10-- To run examples in this module:
10-- To run examples in this module:
11--
11--
12−-- >>> import qualified Streamly.Prelude as Stream
12+-- >>> import qualified Streamly.Internal.Data.Stream as Stream
13+-- >>> import qualified Streamly.Data.Fold as Fold
13--
14--
14module Streamly.Internal.Data.Stream.Zip.Concurrent
15module Streamly.Internal.Data.Stream.Zip.Concurrent
15 (
16 (
src/Streamly/Internal/Data/Stream/ZipAsync.hs+1
@@ -39,6 +39,7 @@ import Prelude hiding (map, repeat, zipWith, errorWithoutStackTrace)
39#include "Instances.hs"
39#include "Instances.hs"
40
40
41-- $setup
41-- $setup
42+-- >>> :set -fno-warn-deprecations
42-- >>> import qualified Streamly.Prelude as Stream
43-- >>> import qualified Streamly.Prelude as Stream
43-- >>> import Control.Concurrent (threadDelay)
44-- >>> import Control.Concurrent (threadDelay)
44-- >>> :{
45-- >>> :{
src/Streamly/Internal/Network/Inet/TCP.hs+3−2
@@ -124,7 +124,7 @@ import qualified Streamly.Internal.Data.Unfold as UF (bracket, first)
124import qualified Streamly.Internal.Data.Array.Unboxed.Stream as AS
124import qualified Streamly.Internal.Data.Array.Unboxed.Stream as AS
125import qualified Streamly.Internal.Data.Fold.Type as FL
125import qualified Streamly.Internal.Data.Fold.Type as FL
126 (initialize, snoc, Step(..))
126 (initialize, snoc, Step(..))
127−import qualified Streamly.Internal.Data.Stream.IsStream as S
127+import qualified Streamly.Internal.Data.Stream as S
128import qualified Streamly.Internal.Network.Socket as ISK
128import qualified Streamly.Internal.Network.Socket as ISK
129
129
130-------------------------------------------------------------------------------
130-------------------------------------------------------------------------------
@@ -346,7 +346,8 @@ putChunks
346 -> Stream m (Array Word8)
346 -> Stream m (Array Word8)
347 -> m ()
347 -> m ()
348putChunks addr port xs =
348putChunks addr port xs =
349+ S.fold FL.drain
349− S.drain $ withConnection addr port (\sk -> S.fromEffect $ ISK.putChunks sk xs)
350+ $ withConnection addr port (\sk -> S.fromEffect $ ISK.putChunks sk xs)
350
351
351-- | Write a stream of arrays to the supplied IPv4 host address and port
352-- | Write a stream of arrays to the supplied IPv4 host address and port
352-- number.
353-- number.
src/Streamly/Internal/Unicode/Char.hs+8−3
@@ -30,10 +30,11 @@ where
30
30
31import Data.Char (isAsciiUpper, isAsciiLower, chr, ord)
31import Data.Char (isAsciiUpper, isAsciiLower, chr, ord)
32import Unicode.Char (DecomposeMode(..))
32import Unicode.Char (DecomposeMode(..))
33−import Streamly.Internal.Data.Stream.IsStream.Type
33+import Streamly.Internal.Data.Stream (fromStreamD, toStreamD)
34− (IsStream, fromStreamD, toStreamD)
35import Streamly.Internal.Data.Stream.StreamD (Stream(..), Step (..))
34import Streamly.Internal.Data.Stream.StreamD (Stream(..), Step (..))
36
35
36+import qualified Streamly.Internal.Data.Stream as Stream (Stream)
37+
37import qualified Unicode.Char as Char
38import qualified Unicode.Char as Char
38
39
39-------------------------------------------------------------------------------
40-------------------------------------------------------------------------------
@@ -313,5 +314,9 @@ normalizeD NFKD = decomposeD True Kompat
313normalizeD NFC = partialComposeD . decomposeD False Canonical
314normalizeD NFC = partialComposeD . decomposeD False Canonical
314normalizeD NFKC = partialComposeD . decomposeD False Kompat
315normalizeD NFKC = partialComposeD . decomposeD False Kompat
315
316
317+normalize ::
318+ Monad m
316−normalize :: (IsStream t, Monad m) => NormalizationMode -> t m Char -> t m Char
319+ => NormalizationMode
320+ -> Stream.Stream m Char
321+ -> Stream.Stream m Char
317normalize mode = fromStreamD . normalizeD mode . toStreamD
322normalize mode = fromStreamD . normalizeD mode . toStreamD
src/Streamly/Internal/Unicode/Utf8.hs+7−4
@@ -27,9 +27,12 @@ import Data.Word (Word8)
27import Streamly.Data.Array.Unboxed (Array)
27import Streamly.Data.Array.Unboxed (Array)
28import System.IO.Unsafe (unsafePerformIO)
28import System.IO.Unsafe (unsafePerformIO)
29
29
30+import qualified Streamly.Data.Fold as Fold
31+import qualified Streamly.Data.Stream as Stream
30−import qualified Streamly.Internal.Data.Array.Unboxed as Array
32+import qualified Streamly.Internal.Data.Array.Unboxed as Array
31− (fromStreamN, read)
33+ ( fromStreamN
32−import qualified Streamly.Internal.Data.Stream.IsStream as Stream
34+ , read
35+ )
33import qualified Streamly.Internal.Unicode.Stream as Unicode
36import qualified Streamly.Internal.Unicode.Stream as Unicode
34
37
35--------------------------------------------------------------------------------
38--------------------------------------------------------------------------------
@@ -65,4 +68,4 @@ pack s =
65unpack :: Utf8 -> String
68unpack :: Utf8 -> String
66unpack u =
69unpack u =
67 unsafePerformIO
70 unsafePerformIO
68− $ Stream.toList $ Unicode.decodeUtf8' $ Array.read $ toArray u
71+ $ Stream.fold Fold.toList $ Unicode.decodeUtf8' $ Array.read $ toArray u
src/Streamly/Prelude.hs+3−1
@@ -1,3 +1,4 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
1{-# OPTIONS_GHC -Wno-orphans #-}
2{-# OPTIONS_GHC -Wno-orphans #-}
2
3
3#include "inline.hs"
4#include "inline.hs"
@@ -317,7 +318,7 @@
317-- documentation for illustration. The actual implementation may differ for
318-- documentation for illustration. The actual implementation may differ for
318-- performance reasons.
319-- performance reasons.
319
320
320−module Streamly.Prelude
321+module Streamly.Prelude {-# DEPRECATED "Please use \"Streamly.Data.Stream\", \"Streamly.Data.Stream.Concurrent\", & \"Streamly.Data.Stream.Time\" instead." #-}
321 (
322 (
322 -- * Construction
323 -- * Construction
323 -- | Functions ending in the general shape @b -> t m a@.
324 -- | Functions ending in the general shape @b -> t m a@.
@@ -945,6 +946,7 @@ import Prelude
945import Streamly.Internal.Data.Stream.IsStream
946import Streamly.Internal.Data.Stream.IsStream
946
947
947-- $setup
948-- $setup
949+-- >>> :set -fno-warn-deprecations
948-- >>> import qualified Streamly.Data.Fold as Fold
950-- >>> import qualified Streamly.Data.Fold as Fold
949-- >>> import qualified Streamly.Prelude as Stream
951-- >>> import qualified Streamly.Prelude as Stream
950
952
test/Streamly/Test/Data/Array.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Data.Array
4-- Module : Streamly.Test.Data.Array
3-- Copyright : (c) 2019 Composewell Technologies
5-- Copyright : (c) 2019 Composewell Technologies
test/Streamly/Test/Data/Array/Stream/Unboxed.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1module Main (main) where
3module Main (main) where
2
4
3import Data.Word (Word8)
5import Data.Word (Word8)
test/Streamly/Test/Data/SmallArray.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Data.SmallArray
4-- Module : Streamly.Test.Data.SmallArray
3-- Copyright : (c) 2020 Composewell technologies
5-- Copyright : (c) 2020 Composewell technologies
test/Streamly/Test/FileSystem/Event/Common.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.FileSystem.Event.Common
4-- Module : Streamly.Test.FileSystem.Event.Common
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Network/Inet/TCP.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Network.Socket
4-- Module : Streamly.Test.Network.Socket
3-- Copyright : (c) 2020 Composewell technologies
5-- Copyright : (c) 2020 Composewell technologies
test/Streamly/Test/Network/Socket.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Network.Socket
4-- Module : Streamly.Test.Network.Socket
3-- Copyright : (c) 2020 Composewell technologies
5-- Copyright : (c) 2020 Composewell technologies
test/Streamly/Test/Prelude.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude
4-- Module : Streamly.Test.Prelude
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Ahead.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude.Ahead
4-- Module : Streamly.Test.Prelude.Ahead
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Async.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude.Async
4-- Module : Streamly.Test.Prelude.Async
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Concurrent.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude.Concurrent
4-- Module : Streamly.Test.Prelude.Concurrent
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Fold.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude.Fold
4-- Module : Streamly.Test.Prelude.Fold
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Parallel.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude.Parallel
4-- Module : Streamly.Test.Prelude.Parallel
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Rate.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude.MaxRate
4-- Module : Streamly.Test.Prelude.MaxRate
3-- Copyright : (c) 2018 Composewell Technologies
5-- Copyright : (c) 2018 Composewell Technologies
test/Streamly/Test/Prelude/Serial.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude.Serial
4-- Module : Streamly.Test.Prelude.Serial
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Top.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1module Main (main) where
3module Main (main) where
2
4
3import Data.List (elem, intersect, nub, sort)
5import Data.List (elem, intersect, nub, sort)
test/Streamly/Test/Prelude/WAsync.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude.WAsync
4-- Module : Streamly.Test.Prelude.WAsync
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/WSerial.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude.WSerial
4-- Module : Streamly.Test.Prelude.WSerial
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/ZipAsync.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude.ZipAsync
4-- Module : Streamly.Test.Prelude.ZipAsync
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/ZipSerial.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude.ZipSerial
4-- Module : Streamly.Test.Prelude.ZipSerial
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Unicode/Stream.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1module Streamly.Test.Unicode.Stream (main) where
3module Streamly.Test.Unicode.Stream (main) where
2
4
3import Data.Char (ord, chr)
5import Data.Char (ord, chr)
test/lib/Streamly/Test/Prelude/Common.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
1-- |
3-- |
2-- Module : Streamly.Test.Prelude.Common
4-- Module : Streamly.Test.Prelude.Common
3-- Copyright : (c) 2020 Composewell Technologies
5-- Copyright : (c) 2020 Composewell Technologies