Deprecate Streamly.Prelude & S.Internal.Data.Stream.IsStream.*
commit5327f181db2cf956461b74ed50720eebf119f25a
authorAdithya Kumar <adithya@composewell.com>
dateWed 19 Oct 2022, 22:55 (4 years ago)
parent326b055
benchmark/NanoBenchmarks.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-------------------------------------------------------------------------------
24-- Investigate specific benchmarks more closely in isolation, possibly looking
35-- 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+
13{-# LANGUAGE CPP #-}
24
35#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+
13{-# LANGUAGE CPP #-}
24
35#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+
13-- |
24-- Module : Streamly.Benchmark.Data.ParserD
35-- Copyright : (c) 2020 Composewell Technologies
benchmark/Streamly/Benchmark/Data/Array/Unboxed.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13{-# LANGUAGE CPP #-}
24
35#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+
13-- |
24-- Module : Streamly.Benchmark.Data.Array.Unboxed.Mut
35-- Copyright : (c) 2021 Composewell Technologies
benchmark/Streamly/Benchmark/Data/Fold/Window.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13module Main (main) where
24
35import Control.DeepSeq (NFData)
benchmark/Streamly/Benchmark/Data/Parser.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Benchmark.Data.Parser
35-- Copyright : (c) 2020 Composewell Technologies
benchmark/Streamly/Benchmark/Data/Parser/ParserD.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Benchmark.Data.ParserD
35-- Copyright : (c) 2020 Composewell Technologies
benchmark/Streamly/Benchmark/Data/Stream/Common.hs+4
@@ -9,6 +9,10 @@
99-- License : BSD-3-Clause
1010-- Maintainer : streamly@composewell.com
1111
12+#ifdef USE_PRELUDE
13+{-# OPTIONS_GHC -Wno-deprecations #-}
14+#endif
15+
1216module Stream.Common
1317 ( MonadAsync
1418
benchmark/Streamly/Benchmark/Data/Stream/Eliminate.hs+4
@@ -9,6 +9,10 @@
99{-# LANGUAGE ScopedTypeVariables #-}
1010{-# LANGUAGE RankNTypes #-}
1111
12+#ifdef USE_PRELUDE
13+{-# OPTIONS_GHC -Wno-deprecations #-}
14+#endif
15+
1216#ifdef __HADDOCK_VERSION__
1317#undef INSPECTION
1418#endif
benchmark/Streamly/Benchmark/Data/Stream/Exceptions.hs+4
@@ -10,6 +10,10 @@
1010{-# LANGUAGE FlexibleContexts #-}
1111{-# LANGUAGE ScopedTypeVariables #-}
1212
13+#ifdef USE_PRELUDE
14+{-# OPTIONS_GHC -Wno-deprecations #-}
15+#endif
16+
1317#ifdef __HADDOCK_VERSION__
1418#undef INSPECTION
1519#endif
benchmark/Streamly/Benchmark/Data/Stream/Expand.hs+4
@@ -10,6 +10,10 @@
1010{-# LANGUAGE RankNTypes #-}
1111{-# LANGUAGE TupleSections #-}
1212
13+#ifdef USE_PRELUDE
14+{-# OPTIONS_GHC -Wno-deprecations #-}
15+#endif
16+
1317#ifdef __HADDOCK_VERSION__
1418#undef INSPECTION
1519#endif
benchmark/Streamly/Benchmark/Data/Stream/Generate.hs+4
@@ -9,6 +9,10 @@
99{-# LANGUAGE ScopedTypeVariables #-}
1010{-# LANGUAGE RankNTypes #-}
1111
12+#ifdef USE_PRELUDE
13+{-# OPTIONS_GHC -Wno-deprecations #-}
14+#endif
15+
1216module Stream.Generate (benchmarks) where
1317
1418import Data.Functor.Identity (Identity)
benchmark/Streamly/Benchmark/Data/Stream/Lift.hs+4
@@ -9,6 +9,10 @@
99{-# LANGUAGE ScopedTypeVariables #-}
1010{-# LANGUAGE RankNTypes #-}
1111
12+#ifdef USE_PRELUDE
13+{-# OPTIONS_GHC -Wno-deprecations #-}
14+#endif
15+
1216module Stream.Lift (benchmarks) where
1317
1418import Control.DeepSeq (NFData(..))
benchmark/Streamly/Benchmark/Data/Stream/Reduce.hs+4
@@ -11,6 +11,10 @@
1111{-# LANGUAGE DeriveGeneric #-}
1212{-# LANGUAGE RankNTypes #-}
1313
14+#ifdef USE_PRELUDE
15+{-# OPTIONS_GHC -Wno-deprecations #-}
16+#endif
17+
1418module Stream.Reduce (benchmarks) where
1519
1620import Control.DeepSeq (NFData(..))
benchmark/Streamly/Benchmark/Data/Stream/Split.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Stream.Split
35-- Copyright : (c) 2019 Composewell Technologies
benchmark/Streamly/Benchmark/Data/Stream/StreamDK.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Benchmark.Data.Stream.StreamDK
35-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Data/Stream/Transform.hs+4
@@ -9,6 +9,10 @@
99{-# LANGUAGE ScopedTypeVariables #-}
1010{-# LANGUAGE RankNTypes #-}
1111
12+#ifdef USE_PRELUDE
13+{-# OPTIONS_GHC -Wno-deprecations #-}
14+#endif
15+
1216#ifdef __HADDOCK_VERSION__
1317#undef INSPECTION
1418#endif
benchmark/Streamly/Benchmark/FileSystem/Handle/Read.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Benchmark.FileSystem.Handle
35-- Copyright : (c) 2019 Composewell Technologies
benchmark/Streamly/Benchmark/FileSystem/Handle/ReadWrite.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Benchmark.FileSystem.Handle
35-- Copyright : (c) 2019 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/Adaptive.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Main
35-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/Ahead.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Main
35-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/Async.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Main
35-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/Concurrent.hs+1
@@ -1,3 +1,4 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
12{-# LANGUAGE CPP #-}
23{-# LANGUAGE RankNTypes #-}
34-- |
benchmark/Streamly/Benchmark/Prelude/Merge.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Main
35-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/Parallel.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Main
35-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/Rate.hs+1
@@ -1,3 +1,4 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
12{-# LANGUAGE FlexibleContexts #-}
23
34-- |
benchmark/Streamly/Benchmark/Prelude/WAsync.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Main
35-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/WSerial.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Main
35-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/ZipAsync.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Main
35-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Prelude/ZipSerial.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Main
35-- Copyright : (c) 2018 Composewell Technologies
benchmark/Streamly/Benchmark/Unicode/Char.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13--
24-- Module : Streamly.Unicode.Char
35-- Copyright : (c) 2021 Composewell Technologies
benchmark/Streamly/Benchmark/Unicode/Stream.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13--
24-- Module : Streamly.Unicode.Stream
35-- Copyright : (c) 2019 Composewell Technologies
benchmark/lib/Streamly/Benchmark/Prelude.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Benchmark.Prelude
35-- 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)
146146-- >>> import qualified Streamly.Data.Array.Unboxed as Array
147147-- >>> import qualified Streamly.Data.Fold as Fold
148148-- >>> import qualified Streamly.Data.Unfold as Unfold
149−-- >>> import qualified Streamly.Prelude as Stream
149+-- >>> import qualified Streamly.Data.Stream as Stream
150150--
151151-- >>> 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
153153-- >>> import qualified Streamly.Internal.Data.Unfold as Unfold (first)
154154-- >>> import qualified Streamly.Internal.FileSystem.Handle as Handle
155155-- >>> import qualified Streamly.Internal.System.IO as IO (defaultChunkSize)
@@ -410,7 +410,7 @@ putChunk h arr = A.asPtrUnsafe arr $ \ptr ->
410410-- XXX use an unfold to fromObjects or fromUnfold so that we can put any object
411411-- | Write a stream of arrays to a handle.
412412--
413−-- >>> putChunks h = Stream.mapM_ (Handle.putChunk h)
413+-- >>> putChunks h = Stream.fold (Fold.drainBy (Handle.putChunk h))
414414--
415415-- @since 0.7.0
416416{-# INLINE putChunks #-}
core/src/Streamly/Internal/Unicode/Array/Char.hs+6−5
@@ -30,7 +30,8 @@ import Prelude hiding (String, lines, words, unlines, unwords)
3030-- >>> :m
3131-- >>> :set -XOverloadedStrings
3232-- >>> 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
3435-- >>> import qualified Streamly.Internal.Unicode.Array.Char as Unicode
3536
3637-- | Break a string up into a stream of strings at newline characters.
@@ -38,7 +39,7 @@ import Prelude hiding (String, lines, words, unlines, unwords)
3839--
3940-- > lines = S.lines A.write
4041--
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"
4243-- ["lines","this","string","",""]
4344--
4445{-# INLINE lines #-}
@@ -50,7 +51,7 @@ lines = S.lines A.write
5051--
5152-- > words = S.words A.write
5253--
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?"
5455-- ["A","newline","is","considered","white","space?"]
5556--
5657{-# INLINE words #-}
@@ -62,7 +63,7 @@ words = S.words A.write
6263--
6364-- 'unlines' is an inverse operation to 'lines'.
6465--
65−-- >>> Stream.toList $ Unicode.unlines $ Stream.fromList ["lines", "this", "string"]
66+-- >>> Stream.fold Fold.toList $ Unicode.unlines $ Stream.fromList ["lines", "this", "string"]
6667-- "lines\nthis\nstring\n"
6768--
6869-- > unlines = S.unlines A.read
@@ -79,7 +80,7 @@ unlines = S.unlines A.reader
7980--
8081-- 'unwords' is an inverse operation to 'words'.
8182--
82−-- >>> Stream.toList $ Unicode.unwords $ Stream.fromList ["unwords", "this", "string"]
83+-- >>> Stream.fold Fold.toList $ Unicode.unwords $ Stream.fromList ["unwords", "this", "string"]
8384-- "unwords this string"
8485--
8586-- > 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)
128128-- >>> :m
129129-- >>> :set -XMagicHash
130130-- >>> import Prelude hiding (lines, words, unlines, unwords)
131−-- >>> import qualified Streamly.Prelude as Stream
131+-- >>> import qualified Streamly.Data.Stream as Stream
132132-- >>> import qualified Streamly.Data.Fold as Fold
133133-- >>> import qualified Streamly.Internal.Unicode.Stream as Unicode
134134-- >>> import Streamly.Internal.Unicode.Stream
@@ -1066,7 +1066,7 @@ stripHead = Stream.dropWhile isSpace
10661066-- | Fold each line of the stream using the supplied 'Fold'
10671067-- and stream the result.
10681068--
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")
10701070-- ["lines","this","string","",""]
10711071--
10721072-- > lines = Stream.splitOnSuffix (== '\n')
@@ -1097,7 +1097,7 @@ isSpace c
10971097-- | Fold each word of the stream using the supplied 'Fold'
10981098-- and stream the result.
10991099--
1100−-- >>> Stream.toList $ words Fold.toList (Stream.fromList "fold these words")
1100+-- >>> Stream.fold Fold.toList $ words Fold.toList (Stream.fromList "fold these words")
11011101-- ["fold","these","words"]
11021102--
11031103-- > words = Stream.wordsBy isSpace
docs/User/Tutorials/ConcurrentStreams.hs+4−1
@@ -87,7 +87,7 @@ module User.Tutorials.ConcurrentStreams
8787 )
8888where
8989
90−import Streamly.Prelude
90+import Streamly.Data.Stream
9191import Data.Semigroup
9292import Control.Applicative
9393import Control.Monad
@@ -96,8 +96,11 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
9696
9797-- CAUTION: please keep setup and imports sections in sync
9898
99+-- XXX This tutorial has to be rewritten.
100+
99101-- $setup
100102-- >>> :m
103+-- >>> :set -fno-warn-deprecations
101104-- >>> import Data.Function ((&))
102105-- >>> import Streamly.Prelude ((|:), (|&))
103106-- >>> import qualified Streamly.Prelude as Stream
docs/User/Tutorials/ReactiveProgramming.hs+1−1
@@ -20,7 +20,7 @@ module User.Tutorials.ReactiveProgramming
2020 )
2121where
2222
23−import Streamly.Prelude
23+import Streamly.Data.Stream
2424import Data.Semigroup
2525import Control.Applicative
2626import Control.Monad
docs/User/Tutorials/Tutorial.hs+4−1
@@ -74,7 +74,7 @@ module User.Tutorials.Tutorial
7474 )
7575where
7676
77−import Streamly.Prelude
77+import Streamly.Data.Stream
7878import Data.Semigroup
7979import Control.Applicative
8080import Control.Monad
@@ -83,8 +83,11 @@ import Control.Monad.Trans.Class (MonadTrans (lift))
8383
8484-- CAUTION: please keep setup and imports sections in sync
8585
86+-- XXX This tutorial has to be re-written.
87+
8688-- $setup
8789-- >>> :m
90+-- >>> :set -fno-warn-deprecations
8891-- >>> import Data.Function ((&))
8992-- >>> import Streamly.Prelude ((|:), (|&))
9093-- >>> import qualified Streamly.Prelude as Stream
src/Streamly.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly
35-- Copyright : (c) 2017 Composewell Technologies
src/Streamly/Data/Array/Foreign.hs+1
@@ -97,6 +97,7 @@ import Streamly.Internal.Data.Array.Unboxed as A
9797
9898-- $setup
9999-- >>> :m
100+-- >>> :set -fno-warn-deprecations
100101-- >>> :set -XFlexibleContexts
101102-- >>> :set -package streamly
102103-- >>> 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'(..))
2828
2929-- $setup
3030-- >>> :m
31+-- >>> :set -fno-warn-deprecations
3132-- >>> :set -XFlexibleContexts
3233-- >>> import qualified Streamly.Prelude as Stream
3334-- >>> import qualified Streamly.Data.Fold as Fold
src/Streamly/Internal/Data/Stream/Ahead.hs+1
@@ -64,6 +64,7 @@ import Prelude hiding (map)
6464#include "Instances.hs"
6565
6666-- $setup
67+-- >>> :set -fno-warn-deprecations
6768-- >>> import qualified Streamly.Prelude as Stream
6869-- >>> import Control.Concurrent (threadDelay)
6970-- >>> :{
src/Streamly/Internal/Data/Stream/Async.hs+1
@@ -73,6 +73,7 @@ import Streamly.Internal.Data.SVar
7373#include "Instances.hs"
7474
7575-- $setup
76+-- >>> :set -fno-warn-deprecations
7677-- >>> import qualified Streamly.Prelude as Stream
7778-- >>> import Control.Concurrent (threadDelay)
7879-- >>> :{
src/Streamly/Internal/Data/Stream/IsStream.hs+3−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Internal.Data.Stream.IsStream
35-- Copyright : (c) 2017 Composewell Technologies
@@ -10,7 +12,7 @@
1012-- module "Streamly.Prelude". It contains some additional unreleased or
1113-- experimental APIs.
1214
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." #-}
1416 ( module Streamly.Internal.Data.Stream.IsStream.Type
1517 , module Streamly.Internal.Data.Stream.IsStream.Generate
1618 , 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+
13-- |
24-- Module : Streamly.Internal.Data.Stream.Combinators
35-- Copyright : (c) 2017 Composewell Technologies
@@ -7,7 +9,7 @@
79-- Portability : GHC
810--
911--
10−module Streamly.Internal.Data.Stream.IsStream.Combinators
12+module Streamly.Internal.Data.Stream.IsStream.Combinators {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
1113 ( maxThreads
1214 , maxBuffer
1315 , maxYields
src/Streamly/Internal/Data/Stream/IsStream/Common.hs+3−1
@@ -1,3 +1,4 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
12{-# OPTIONS_GHC -Wno-orphans #-}
23
34-- |
@@ -11,7 +12,7 @@
1112-- Bottom level IsStream module that can be used by all other upper level
1213-- IsStream modules.
1314
14−module Streamly.Internal.Data.Stream.IsStream.Common
15+module Streamly.Internal.Data.Stream.IsStream.Common {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
1516 (
1617 -- * Generation
1718 fromPure
@@ -98,6 +99,7 @@ import Prelude hiding (take, takeWhile, drop, reverse, concatMap, map, zipWith)
9899--
99100-- $setup
100101-- >>> :m
102+-- >>> :set -fno-warn-deprecations
101103-- >>> import Control.Concurrent (threadDelay)
102104-- >>> import Control.Monad (join)
103105-- >>> 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+
13-- |
24-- Module : Streamly.Internal.Data.Stream.IsStream.Eliminate
35-- Copyright : (c) 2017 Composewell Technologies
@@ -15,7 +17,7 @@
1517-- We call them stream folding functions, they reduce a stream @t m a@ to a
1618-- monadic value @m b@.
1719
18−module Streamly.Internal.Data.Stream.IsStream.Eliminate
20+module Streamly.Internal.Data.Stream.IsStream.Eliminate {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
1921 (
2022 -- * Running Examples
2123 -- $setup
@@ -188,6 +190,7 @@ import Prelude hiding
188190
189191-- $setup
190192-- >>> :m
193+-- >>> :set -fno-warn-deprecations
191194-- >>> import Streamly.Prelude (SerialT)
192195-- >>> import qualified Streamly.Prelude as Stream
193196-- >>> 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+
13-- |
24-- Module : Streamly.Internal.Data.Stream.Enumeration
35-- Copyright : (c) 2018 Composewell Technologies
@@ -20,7 +22,7 @@
2022-- in this module can be used to define them. Alternatively, these functions
2123-- can be used directly.
2224
23−module Streamly.Internal.Data.Stream.IsStream.Enumeration
25+module Streamly.Internal.Data.Stream.IsStream.Enumeration {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
2426 (
2527 Enumerable (..)
2628
@@ -77,6 +79,7 @@ import qualified Streamly.Internal.Data.Stream.StreamD as D
7779import qualified Streamly.Internal.Data.Stream.Serial as Serial (map)
7880
7981-- $setup
82+-- >>> :set -fno-warn-deprecations
8083-- >>> import Streamly.Prelude as Stream
8184-- >>> import Streamly.Internal.Data.Stream.IsStream.Enumeration as Stream
8285
src/Streamly/Internal/Data/Stream/IsStream/Exception.hs+4−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Internal.Data.Stream.IsStream.Exception
35-- Copyright : (c) 2019 Composewell Technologies
@@ -6,7 +8,7 @@
68-- Stability : experimental
79-- Portability : GHC
810
9−module Streamly.Internal.Data.Stream.IsStream.Exception
11+module Streamly.Internal.Data.Stream.IsStream.Exception {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
1012 (
1113 before
1214 , after_
@@ -46,6 +48,7 @@ import qualified Streamly.Internal.Data.Stream.StreamD.Exception as D
4648
4749-- $setup
4850-- >>> :m
51+-- >>> :set -fno-warn-deprecations
4952-- >>> import qualified Streamly.Prelude as Stream
5053-- >>> import qualified Streamly.Internal.Data.Stream.IsStream as Stream (nilM)
5154
src/Streamly/Internal/Data/Stream/IsStream/Expand.hs+4−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Internal.Data.Stream.IsStream.Expand
35-- Copyright : (c) 2017 Composewell Technologies
@@ -9,7 +11,7 @@
911-- Expand a stream by combining two or more streams or by combining streams
1012-- with unfolds.
1113
12−module Streamly.Internal.Data.Stream.IsStream.Expand
14+module Streamly.Internal.Data.Stream.IsStream.Expand {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
1315 (
1416 -- * Binary Combinators (Linear)
1517 -- | Functions ending in the shape:
@@ -190,6 +192,7 @@ import Prelude hiding (concat, concatMap, zipWith)
190192
191193-- $setup
192194-- >>> :m
195+-- >>> :set -fno-warn-deprecations
193196-- >>> import Control.Concurrent (threadDelay)
194197-- >>> import Data.IORef
195198-- >>> 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 #-}
12{-# OPTIONS_GHC -Wno-orphans #-}
23
34-- |
@@ -15,7 +16,7 @@
1516-- as StreamK when StreamK is used, avoiding conversion to StreamD. Will that
1617-- help? Are there any other reasons to keep these and not use unfolds?
1718
18−module Streamly.Internal.Data.Stream.IsStream.Generate
19+module Streamly.Internal.Data.Stream.IsStream.Generate {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
1920 (
2021 -- * Primitives
2122 IsStream.nil
@@ -124,6 +125,7 @@ import Prelude hiding (iterate, replicate, repeat)
124125
125126-- $setup
126127-- >>> :m
128+-- >>> :set -fno-warn-deprecations
127129-- >>> import Data.Function ((&))
128130-- >>> import Prelude hiding (iterate, replicate, repeat)
129131-- >>> 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+
13-- |
24-- Module : Streamly.Internal.Data.Stream.IsStream.Lift
35-- Copyright : (c) 2019 Composewell Technologies
@@ -6,7 +8,7 @@
68-- Stability : experimental
79-- Portability : GHC
810
9−module Streamly.Internal.Data.Stream.IsStream.Lift
11+module Streamly.Internal.Data.Stream.IsStream.Lift {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
1012 (
1113 -- * Generalize Inner Monad
1214 hoist
src/Streamly/Internal/Data/Stream/IsStream/Reduce.hs+4−1
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Internal.Data.Stream.IsStream.Reduce
35-- Copyright : (c) 2017 Composewell Technologies
@@ -8,7 +10,7 @@
810--
911-- Reduce streams by streams, folds or parsers.
1012
11−module Streamly.Internal.Data.Stream.IsStream.Reduce
13+module Streamly.Internal.Data.Stream.IsStream.Reduce {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
1214 (
1315 -- * Reduce By Streams
1416 dropPrefix
@@ -211,6 +213,7 @@ import Prelude hiding (concatMap, map)
211213
212214-- $setup
213215-- >>> :m
216+-- >>> :set -fno-warn-deprecations
214217-- >>> import Prelude hiding (zipWith, concatMap, concat)
215218-- >>> import qualified Streamly.Prelude as Stream
216219-- >>> 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+
13-- |
24-- Module : Streamly.Internal.Data.Stream.IsStream.Top
35-- Copyright : (c) 2020 Composewell Technologies
@@ -9,7 +11,7 @@
911-- Top level IsStream module that can use all other lower level IsStream
1012-- modules.
1113
12−module Streamly.Internal.Data.Stream.IsStream.Top
14+module Streamly.Internal.Data.Stream.IsStream.Top {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
1315 (
1416 -- * Transformation
1517 -- ** Sampling
@@ -87,6 +89,7 @@ import Prelude hiding (filter, zipWith, concatMap, concat)
8789
8890-- $setup
8991-- >>> :m
92+-- >>> :set -fno-warn-deprecations
9093-- >>> import Prelude hiding (filter, zipWith, concatMap, concat)
9194-- >>> import qualified Streamly.Prelude as Stream
9295-- >>> 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+
13-- |
24-- Module : Streamly.Internal.Data.Stream.IsStream.Transform
35-- Copyright : (c) 2017 Composewell Technologies
@@ -6,7 +8,7 @@
68-- Stability : experimental
79-- Portability : GHC
810
9−module Streamly.Internal.Data.Stream.IsStream.Transform
11+module Streamly.Internal.Data.Stream.IsStream.Transform {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
1012 (
1113 -- * Piping
1214 -- | Pass through a 'Pipe'.
@@ -272,6 +274,7 @@ import Prelude hiding
272274--
273275-- $setup
274276-- >>> :m
277+-- >>> :set -fno-warn-deprecations
275278-- >>> import Control.Concurrent (threadDelay)
276279-- >>> import Data.Function ((&))
277280-- >>> import Streamly.Prelude ((|$))
src/Streamly/Internal/Data/Stream/IsStream/Type.hs+2−1
@@ -1,3 +1,4 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
12{-# LANGUAGE UndecidableInstances #-}
23{-# OPTIONS_GHC -Wno-orphans #-}
34
@@ -10,7 +11,7 @@
1011-- Portability : GHC
1112--
1213--
13−module Streamly.Internal.Data.Stream.IsStream.Type
14+module Streamly.Internal.Data.Stream.IsStream.Type {-# DEPRECATED "Please use \"Streamly.Data.Stream.*\" instead." #-}
1415 (
1516 -- * IsStream Type Class
1617 IsStream (..)
src/Streamly/Internal/Data/Stream/Serial.hs+1
@@ -79,6 +79,7 @@ import Prelude hiding (map, mapM, repeat, filter)
7979#include "inline.hs"
8080
8181-- $setup
82+-- >>> :set -fno-warn-deprecations
8283-- >>> import qualified Streamly.Data.Stream as Stream
8384-- >>> import qualified Streamly.Prelude as IsStream
8485
src/Streamly/Internal/Data/Stream/Zip/Concurrent.hs+2−1
@@ -9,7 +9,8 @@
99--
1010-- To run examples in this module:
1111--
12−-- >>> import qualified Streamly.Prelude as Stream
12+-- >>> import qualified Streamly.Internal.Data.Stream as Stream
13+-- >>> import qualified Streamly.Data.Fold as Fold
1314--
1415module Streamly.Internal.Data.Stream.Zip.Concurrent
1516 (
src/Streamly/Internal/Data/Stream/ZipAsync.hs+1
@@ -39,6 +39,7 @@ import Prelude hiding (map, repeat, zipWith, errorWithoutStackTrace)
3939#include "Instances.hs"
4040
4141-- $setup
42+-- >>> :set -fno-warn-deprecations
4243-- >>> import qualified Streamly.Prelude as Stream
4344-- >>> import Control.Concurrent (threadDelay)
4445-- >>> :{
src/Streamly/Internal/Network/Inet/TCP.hs+3−2
@@ -124,7 +124,7 @@ import qualified Streamly.Internal.Data.Unfold as UF (bracket, first)
124124import qualified Streamly.Internal.Data.Array.Unboxed.Stream as AS
125125import qualified Streamly.Internal.Data.Fold.Type as FL
126126 (initialize, snoc, Step(..))
127−import qualified Streamly.Internal.Data.Stream.IsStream as S
127+import qualified Streamly.Internal.Data.Stream as S
128128import qualified Streamly.Internal.Network.Socket as ISK
129129
130130-------------------------------------------------------------------------------
@@ -346,7 +346,8 @@ putChunks
346346 -> Stream m (Array Word8)
347347 -> m ()
348348putChunks addr port xs =
349− S.drain $ withConnection addr port (\sk -> S.fromEffect $ ISK.putChunks sk xs)
349+ S.fold FL.drain
350+ $ withConnection addr port (\sk -> S.fromEffect $ ISK.putChunks sk xs)
350351
351352-- | Write a stream of arrays to the supplied IPv4 host address and port
352353-- number.
src/Streamly/Internal/Unicode/Char.hs+8−3
@@ -30,10 +30,11 @@ where
3030
3131import Data.Char (isAsciiUpper, isAsciiLower, chr, ord)
3232import Unicode.Char (DecomposeMode(..))
33−import Streamly.Internal.Data.Stream.IsStream.Type
34− (IsStream, fromStreamD, toStreamD)
33+import Streamly.Internal.Data.Stream (fromStreamD, toStreamD)
3534import Streamly.Internal.Data.Stream.StreamD (Stream(..), Step (..))
3635
36+import qualified Streamly.Internal.Data.Stream as Stream (Stream)
37+
3738import qualified Unicode.Char as Char
3839
3940-------------------------------------------------------------------------------
@@ -313,5 +314,9 @@ normalizeD NFKD = decomposeD True Kompat
313314normalizeD NFC = partialComposeD . decomposeD False Canonical
314315normalizeD NFKC = partialComposeD . decomposeD False Kompat
315316
316−normalize :: (IsStream t, Monad m) => NormalizationMode -> t m Char -> t m Char
317+normalize ::
318+ Monad m
319+ => NormalizationMode
320+ -> Stream.Stream m Char
321+ -> Stream.Stream m Char
317322normalize mode = fromStreamD . normalizeD mode . toStreamD
src/Streamly/Internal/Unicode/Utf8.hs+7−4
@@ -27,9 +27,12 @@ import Data.Word (Word8)
2727import Streamly.Data.Array.Unboxed (Array)
2828import System.IO.Unsafe (unsafePerformIO)
2929
30−import qualified Streamly.Internal.Data.Array.Unboxed as Array
31− (fromStreamN, read)
32−import qualified Streamly.Internal.Data.Stream.IsStream as Stream
30+import qualified Streamly.Data.Fold as Fold
31+import qualified Streamly.Data.Stream as Stream
32+import qualified Streamly.Internal.Data.Array.Unboxed as Array
33+ ( fromStreamN
34+ , read
35+ )
3336import qualified Streamly.Internal.Unicode.Stream as Unicode
3437
3538--------------------------------------------------------------------------------
@@ -65,4 +68,4 @@ pack s =
6568unpack :: Utf8 -> String
6669unpack u =
6770 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 #-}
12{-# OPTIONS_GHC -Wno-orphans #-}
23
34#include "inline.hs"
@@ -317,7 +318,7 @@
317318-- documentation for illustration. The actual implementation may differ for
318319-- performance reasons.
319320
320−module Streamly.Prelude
321+module Streamly.Prelude {-# DEPRECATED "Please use \"Streamly.Data.Stream\", \"Streamly.Data.Stream.Concurrent\", & \"Streamly.Data.Stream.Time\" instead." #-}
321322 (
322323 -- * Construction
323324 -- | Functions ending in the general shape @b -> t m a@.
@@ -945,6 +946,7 @@ import Prelude
945946import Streamly.Internal.Data.Stream.IsStream
946947
947948-- $setup
949+-- >>> :set -fno-warn-deprecations
948950-- >>> import qualified Streamly.Data.Fold as Fold
949951-- >>> import qualified Streamly.Prelude as Stream
950952
test/Streamly/Test/Data/Array.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Data.Array
35-- Copyright : (c) 2019 Composewell Technologies
test/Streamly/Test/Data/Array/Stream/Unboxed.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13module Main (main) where
24
35import Data.Word (Word8)
test/Streamly/Test/Data/SmallArray.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Data.SmallArray
35-- Copyright : (c) 2020 Composewell technologies
test/Streamly/Test/FileSystem/Event/Common.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.FileSystem.Event.Common
35-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Network/Inet/TCP.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Network.Socket
35-- Copyright : (c) 2020 Composewell technologies
test/Streamly/Test/Network/Socket.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Network.Socket
35-- Copyright : (c) 2020 Composewell technologies
test/Streamly/Test/Prelude.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude
35-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Ahead.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude.Ahead
35-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Async.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude.Async
35-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Concurrent.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude.Concurrent
35-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Fold.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude.Fold
35-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Parallel.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude.Parallel
35-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Rate.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude.MaxRate
35-- Copyright : (c) 2018 Composewell Technologies
test/Streamly/Test/Prelude/Serial.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude.Serial
35-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/Top.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13module Main (main) where
24
35import Data.List (elem, intersect, nub, sort)
test/Streamly/Test/Prelude/WAsync.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude.WAsync
35-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/WSerial.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude.WSerial
35-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/ZipAsync.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude.ZipAsync
35-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Prelude/ZipSerial.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude.ZipSerial
35-- Copyright : (c) 2020 Composewell Technologies
test/Streamly/Test/Unicode/Stream.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13module Streamly.Test.Unicode.Stream (main) where
24
35import Data.Char (ord, chr)
test/lib/Streamly/Test/Prelude/Common.hs+2
@@ -1,3 +1,5 @@
1+{-# OPTIONS_GHC -Wno-deprecations #-}
2+
13-- |
24-- Module : Streamly.Test.Prelude.Common
35-- Copyright : (c) 2020 Composewell Technologies