@@ -25,8 +25,11 @@ programmers to control concurrent behavior in a more robust way and
2525reduce pitfalls.
2626
2727The old code can be adapted to use the new modules with some
28−changes. More details about this is supplied in the following
29−sections. Assume the following imports in the code snippets below:
28+changes. More details about this is supplied in the following sections.
29+Please open an issue if you cannot find a way to adapt the code to the new
30+release.
31+
32+Assume the following imports in the code snippets below:
3033
3134```haskell docspec
3235>>> import qualified Streamly.Data.Stream as Stream
@@ -55,9 +58,9 @@ you will use most of the time. You can think of it as a replacement for
5558the `SerialT` type. However, it does not provide an Applicative or Monad
5659instance.
5760
58−The `CrossStream` type in `Streamly.Internal.Data.Stream.StreamD` is a
61+The `CrossStream` type in `Streamly.Internal.Data.Stream` is a
5962wrapper over `Stream` type supplying the Monad instance. However, see
60−the "Performance Notes" section in the `Streamly.Data.Stream` module for
63+the "Stream Fusion" section in the `Streamly.Data.Stream` module for
6164limitations of the `Stream` type. The `StreamK` type and `CrossStreamK`
6265(in Streamly.Internal.Data.Stream.StreamK) could be used to overcome the
6366limitations of `Stream` type.
@@ -88,7 +91,6 @@ Explicit stream fold functions have been omitted from the new stream
8891module. You can use the following equivalent definitions:
8992
9093```haskell docspec
91−>>> toList = Stream.fold Fold.toList
9294>>> the = Stream.fold Fold.the
9395>>> sum = Stream.fold Fold.sum
9496>>> product = Stream.fold Fold.product
@@ -106,23 +108,21 @@ module. You can use the following equivalent definitions:
106108>>> length = Stream.fold Fold.length
107109>>> last = Stream.fold Fold.latest
108110>>> head = Stream.fold Fold.one
109−>>> foldr f a = Stream.fold (Fold.foldr' f a)
110111>>> foldlM' f a = Stream.fold (Fold.foldlM' f a)
111112>>> foldl1 f = Stream.fold (Fold.foldl1' f)
112113>>> foldl' f a = Stream.fold (Fold.foldl' f a)
113114>>> findIndex eq = Stream.fold (Fold.findIndex eq)
114115>>> find eq = Stream.fold (Fold.find eq)
115116>>> findM eq = Stream.fold (Fold.findM eq)
116−>>> drainWhile predicate = Stream.fold Fold.drain . Stream.takeWhile predicate
117+>>> drainWhile p = Stream.fold Fold.drain . Stream.takeWhile p
117118>>> drainN i = Stream.fold Fold.drain . Stream.take i
118119>>> drain = Stream.fold Fold.drain
119−>>> any predicate = Stream.fold (Fold.any predicate)
120+>>> any p = Stream.fold (Fold.any p)
120121>>> and = Stream.fold Fold.and
121−>>> all predicate = Stream.fold (Fold.all predicate)
122+>>> all p = Stream.fold (Fold.all p)
122123>>> (!!) i = Stream.fold (Fold.index i)
123124>>> tail = Streamly.Internal.Data.Stream.StreamK.tail
124125>>> init = Streamly.Internal.Data.Stream.StreamK.init
125−>>> foldrM = Streamly.Internal.Data.Stream.StreamD.foldrM
126126```
127127
128128Mapping functions:
@@ -155,33 +155,32 @@ Filters:
155155>>> elemIndices a = findIndices (== a)
156156```
157157
158−Direct implementations of most of these folds, scans and filters are also
159−available in the `Streamly.Internal.Data.Stream.StreamD` module. Those may in
160−fact be better fusible in some situations.
158+Custom implementations of most of these folds, scans and filters are also
159+available in the `Streamly.Internal.Data.Stream` module.
161160
162161## Stream splitting and grouping functions
163162
164163Stream splitting and grouping functions like `splitOn`, `wordsBy`, and
165164`groupsBy` have been omitted from the new stream module as these can
166165now be implemented using `foldMany` and an appropriate fold from the
167−`Streamly.Data.Fold` module or using `parseMany` and an appropriate
166+`Streamly.Data.Fold` module, or using `parseMany` and an appropriate
168167parser from the `Streamly.Data.Parser` module.
169168
170169```haskell docspec
171170>>> uniq = Stream.scanMaybe (Fold.uniqBy (==))
172−>>> splitWithSuffix predicate f = Stream.foldMany (Fold.takeEndBy predicate f)
173−>>> splitOn = Streamly.Internal.Data.Stream.StreamD.splitOn
174−>>> splitOnSuffix predicate f = Stream.foldMany (Fold.takeEndBy_ predicate f)
175−>>> indexedR = Streamly.Internal.Data.Stream.StreamD.indexedR
171+>>> splitWithSuffix p f = Stream.foldMany (Fold.takeEndBy p f)
172+>>> splitOn = Streamly.Internal.Data.Stream.splitOn
173+>>> splitOnSuffix p f = Stream.foldMany (Fold.takeEndBy_ p f)
174+>>> indexedR = Streamly.Internal.Data.Stream.indexedR
176175>>> groupsBy eq fld = Stream.parseMany (Parser.groupBy eq fld)
177176>>> groups = groupsBy (==)
178−>>> groupsByRolling = Streamly.Internal.Data.Stream.StreamD.groupsRollingBy
177+>>> groupsByRolling = Streamly.Internal.Data.Stream.groupsRollingBy
179178>>> wordsBy p f = Stream.parseMany (Parser.wordBy p f)
180179>>> chunksOf n f = Stream.foldMany (Fold.take n f)
181180```
182181
183182Direct implementation of these are also available in
184−`Streamly.Internal.Data.Stream.StreamD`.
183+`Streamly.Internal.Data.Stream`.
185184
186185## Concurrency
187186