on cd25c14 help sign in
567 lines 22 kB history raw
1# Changelog
3<!-- See rendered changelog at https://streamly.composewell.com -->
4## 0.9.0 (Unreleased)
6* Remove support for GHC 8.4.*
7* New modules for unboxed mutable & unboxed immutable arrays are added.
8* The unboxed arrays now require `Unbox` instead of `Storable` for the stored
9 type. The `Unbox` typeclass can be found in `Streamly.Data.Array`.
11* Following APIs have been renamed in Streamly.Network.Socket module:
12 readWithBufferOf -> readWith
13 readChunksWithBufferOf -> readChunksWith
14 writeWithBufferOf -> writeWith
15 writeChunksWithBufferOf -> writeChunksWith
17* Signature changed: Streamly.Data.Unfold.fromStream
19* Add `Streamly.Data.Stream.Concurrent` that provide combinators for handling
20 non-serial streams.
21* Remove the MonadBase instance of the SerialT type.
23### Deprecations
25* In `Streamly.Data.Fold`:
26 * `variance`, and `stdDev` have been deprecated. Please use the
27 `streamly-statistics` package instead.
28 * `serialWith` is deprecated. Use `splitWith` instead.
29* `Streamly.Data.Array.Foreign` is deprecated. Use `Streamly.Data.Array`
30 instead.
31* The type of `replicateM` in `Streamly.Data.Unfold` is changed.
33## 0.8.2 (Mar 2022)
35* Fix performance issues for GHC-9. These changes coupled with GHC changes
36 expected to land in 9.2.2 will bring the performance back to the same levels
37 as before.
39## 0.8.1.1 (Dec 2021)
41* Disable building FileSystem.Events where FS Events isn't supported.
43## 0.8.1 (Nov 2021)
45See API-changelog.txt for new APIs introduced.
47### Bug Fixes
49* Several bug fixes in the Array module:
50 * Fix writeN fold eating away one element when applied multiple times
51 [#1258](https://github.com/composewell/streamly/issues/1258).
52 * Fix potentially writing beyond allocated memory when shrinking. Likely
53 cause of [#944](https://github.com/composewell/streamly/issues/944).
54 * Fix potentially writing beyond allocated memory when writing the last
55 element. Likely cause of
56 [#944](https://github.com/composewell/streamly/issues/944).
57 * Fix missing pointer touch could potentially cause use of freed memory.
58 * Fix unnecessary additional allocation due to a bug
59* Fix a bug in classifySessionsBy, see
60 [PR #1311](https://github.com/composewell/streamly/pull/1311). The bug
61 could cause premature ejection of a session when input events with the
62 same key are split into multiple sessions.
64### Notable Internal API Changes
66* `tapAsync` from `Streamly.Internal.Data.Stream.Parallel` has been moved to
67 `Streamly.Internal.Data.Stream.IsStream` and renamed to `tapAsyncK`.
68* `Fold2` has now been renamed to `Refold` and the corresponding `Fold2`
69 combinators have been either renamed or removed.
71## 0.8.0 (Jun 2021)
73See [API Changelog](/docs/User/ProjectRelated/API-changelog.txt) for a complete list of signature
74changes and new APIs introduced.
76### Breaking changes
78* `Streamly.Prelude`
79 * `fold`: this function may now terminate early without consuming
80 the entire stream. For example, `fold Fold.head stream` would
81 now terminate immediately after consuming the head element from
82 `stream`. This may result in change of behavior in existing programs
83 if the program relies on the evaluation of the full stream.
84* `Streamly.Data.Unicode.Stream`
85 * The following APIs no longer throw errors on invalid input, use new
86 APIs suffixed with a prime for strict behavior:
87 * decodeUtf8
88 * encodeLatin1
89 * encodeUtf8
90* `Streamly.Data.Fold`:
91 * Several instances have been moved to the `Streamly.Data.Fold.Tee`
92 module, please use the `Tee` type to adapt to the changes.
94### Bug Fixes
96* Concurrent Streams: The monadic state for the stream is now propagated across
97 threads. Please refer to
98 [#369](https://github.com/composewell/streamly/issues/369) for more info.
99* `Streamly.Prelude`:
100 * `bracket`, `handle`, and `finally` now also work correctly on streams
101 that aren't fully drained. Also, the resource acquisition and release is
102 atomic with respect to async exceptions.
103 * `iterate`, `iterateM` now consume O(1) space instead of O(n).
104 * `fromFoldableM` is fixed to be concurrent.
105* `Streamly.Network.Inet.TCP`: `accept` and `connect` APIs now close the socket
106 if an exception is thrown.
107* `Streamly.Network.Socket`: `accept` now closes the socket if an exception is
108 thrown.
110### Enhancements
112* See [API Changelog](/docs/User/ProjectRelated/API-changelog.txt) for a complete list of new
113 modules and APIs introduced.
114* The Fold type is now more powerful, the new termination behavior allows
115 to express basic parsing of streams using folds.
116* Many new Fold and Unfold APIs are added.
117* A new module for console IO APIs is added.
118* Experimental modules for the following are added:
119 * Parsing
120 * Deserialization
121 * File system event handling (fsnotify/inotify)
122 * Folds for streams of arrays
123* Experimental `use-c-malloc` build flag to use the c library `malloc` for
124 array allocations. This could be useful to avoid pinned memory fragmentation.
127### Notable Internal/Pre-release API Changes
129Breaking changes:
131* The `Fold` type has changed to accommodate terminating folds.
132* Rename: `Streamly.Internal.Prelude` => `Streamly.Internal.Data.Stream.IsStream`
133* Several other internal modules have been renamed and re-factored.
135Bug fixes:
137* A bug was fixed in the conversion of `MicroSecond64` and `MilliSecond64`
138 (commit e5119626)
139* Bug fix: `classifySessionsBy` now flushes sessions at the end and terminates.
141### Miscellaneous
143* Drop support for GHC 7.10.3.
144* The examples in this package are moved to a new github repo
145 [streamly-examples](https://github.com/composewell/streamly-examples)
147## 0.7.3 (February 2021)
149### Build Issues
151* Fix build issues with primitive package version >= 0.7.1.
152* Fix build issues on armv7.
154## 0.7.2 (April 2020)
156### Bug Fixes
158* Fix a bug in the `Applicative` and `Functor` instances of the `Fold`
159 data type.
161### Build Issues
163* Fix a bug that occasionally caused a build failure on windows when
164 used with `stack` or `stack ghci`.
165* Now builds on 32-bit machines.
166* Now builds with `primitive` package version >= 0.5.4 && <= 0.6.4.0
167* Now builds with newer `QuickCheck` package version >= 2.14 && < 2.15.
168* Now builds with GHC 8.10.
170## 0.7.1 (February 2020)
172### Bug Fixes
174* Fix a bug that caused `findIndices` to return wrong indices in some
175 cases.
176* Fix a bug in `tap`, `chunksOf` that caused memory consumption to
177 increase in some cases.
178* Fix a space leak in concurrent streams (`async`, `wAsync`, and `ahead`) that
179 caused memory consumption to increase with the number of elements in the
180 stream, especially when built with `-threaded` and used with `-N` RTS option.
181 The issue occurs only in cases when a worker thread happens to be used
182 continuously for a long time.
183* Fix scheduling of WAsyncT stream style to be in round-robin fashion.
184* Now builds with `containers` package version < 0.5.8.
185* Now builds with `network` package version >= 3.0.0.0 && < 3.1.0.0.
187### Behavior change
189* Combinators in `Streamly.Network.Inet.TCP` no longer use TCP `NoDelay` and
190 `ReuseAddr` socket options by default. These options can now be specified
191 using appropriate combinators.
193### Performance
195* Now uses `fusion-plugin` package for predictable stream fusion optimizations
196* Significant improvement in performance of concurrent stream operations.
197* Improved space and time performance of `Foldable` instance.
199## 0.7.0 (November 2019)
201### Breaking changes
203* Change the signature of `foldrM` to ensure that it is lazy
204* Change the signature of `iterateM` to ensure that it is lazy.
205* `scanx` would now require an additional `Monad m` constraint.
207### Behavior change
209* Earlier `ParallelT` was unaffected by `maxBuffer` directive, now `maxBuffer`
210 can limit the buffer of a `ParallelT` stream as well. When the buffer becomes
211 full, the producer threads block.
212* `ParallelT` streams no longer have an unlimited buffer by default. Now the
213 buffer for parallel streams is limited to 1500 by default, the same as other
214 concurrent stream types.
216### Deprecations
218* In `Streamly.Prelude`:
219 * `runStream` has been replaced by `drain`
220 * `runN` has been replaced by `drainN`
221 * `runWhile` has been replaced by `drainWhile`
222 * `fromHandle` has been deprecated. Please use
223 `Streamly.FileSystem.Handle.read`, `Streamly.Data.Unicode.Stream.decodeUtf8` and
224 `splitOnSuffix` with `Streamly.Data.Fold.toList` to split the
225 stream to a stream of `String` separated by a newline.
226 * `toHandle` has been deprecated. Please use `intersperse` and `concatUnfold` to
227 add newlines to a stream, `Streamly.Data.Unicode.Stream.encodeUtf8` for encoding and
228 `Streamly.FileSystem.Handle.write` for writing to a file handle.
229 * Deprecate `scanx`, `foldx`, `foldxM`, `foldr1`
230 * Remove deprecated APIs `foldl`, `foldlM`
231 * Replace deprecated API `scan` with a new signature, to scan using Fold.
233* In `Streamly` module:
234 * `runStream` has been deprecated, please use `Streamly.Prelude.drain`
236* Remove deprecated module `Streamly.Time` (moved to Streamly.Internal.Data.Time)
237* Remove module `Streamly.Internal` (functionality moved to the Internal hierarchy)
239### Bug Fixes
241* Fix a bug that caused `uniq` function to yield the same element twice.
242* Fix a bug that caused "thread blocked indefinitely in an MVar operation"
243 exception in a parallel stream.
244* Fix unbounded memory usage (leak) in `parallel` combinator. The bug manifests
245 when large streams are combined using `parallel`.
247### Major Enhancements
249This release contains a lot of new features and major enhancements. For more
250details on the new features described below please see the haddock docs of the
251modules on hackage.
253#### Exception Handling
255See `Streamly.Prelude` for new exception handling combinators like `before`,
256`after`, `bracket`, `onException`, `finally`, `handle` etc.
258#### Composable Folds
260`Streamly.Data.Fold` module provides composable folds (stream consumers). Folds
261allow splitting, grouping, partitioning, unzipping and nesting a stream onto
262multiple folds without breaking the stream. Combinators are provided for
263temporal and spatial window based fold operations, for example, to support
264folding and aggregating data for timeout or inactivity based sessions.
266#### Composable Unfolds
268`Streamly.Data.Unfold` module provides composable stream generators. Unfolds allow
269high performance merging/flattening/combining of stream generators.
271#### Streaming File IO
273`Streamly.FileSystem.Handle` provides handle based streaming file IO
274operations.
276#### Streaming Network IO
278* `Streamly.Network.Socket` provides socket based streaming network IO
279operations.
281* `Streamly.Network.Inet.TCP` provides combinators to build Inet/TCP
282clients and servers.
284#### Concurrent concatMap
286The new `concatMapWith` in `Streamly.Prelude` combinator performs a
287`concatMap` using a supplied merge/concat strategy. This is a very
288powerful combinator as you can, for example, concat streams
289concurrently using this.
291### Other Enhancements
293* Add the following new features/modules:
294 * _Unicode Strings_: `Streamly.Data.Unicode.Stream` module provides
295 encoding/decoding of character streams and other character stream
296 operations.
297 * _Arrays_: `Streamly.Memory.Array` module provides arrays for efficient
298 in-memory buffering and efficient interfacing with IO.
300* Add the following to `Streamly.Prelude`:
301 * `unfold`, `fold`, `scan` and `postscan`
302 * `concatUnfold` to concat a stream after unfolding each element
303 * `intervalsOf` and `chunksOf`
304 * `splitOn`, `splitOnSuffix`, `splitWithSuffix`, and `wordsBy`
305 * `groups`, `groupsBy` and `groupsByRolling`
306 * `postscanl'` and `postscanlM'`
307 * `intersperse` intersperse an element in between consecutive elements in
308 stream
309 * `trace` combinator maps a monadic function on a stream just for side
310 effects
311 * `tap` redirects a copy of the stream to a `Fold`
313## 0.6.1 (March 2019)
315### Bug Fixes
317* Fix a bug that caused `maxThreads` directive to be ignored when rate control
318 was not used.
320### Enhancements
322* Add GHCJS support
323* Remove dependency on "clock" package
325## 0.6.0 (December 2018)
327### Breaking changes
329* `Monad` constraint may be needed on some of the existing APIs (`findIndices`
330 and `elemIndices`).
332### Enhancements
334* Add the following functions to Streamly.Prelude:
335 * Generation: `replicate`, `fromIndices`, `fromIndicesM`
336 * Enumeration: `Enumerable` type class, `enumerateFrom`, `enumerateFromTo`,
337 `enumerateFromThen`, `enumerateFromThenTo`, `enumerate`, `enumerateTo`
338 * Running: `runN`, `runWhile`
339 * Folds: `(!!)`, `maximumBy`, `minimumBy`, `the`
340 * Scans: `scanl1'`, `scanl1M'
341 * Filters: `uniq`, `insertBy`, `deleteBy`, `findM`
342 * Multi-stream: `eqBy`, `cmpBy`, `mergeBy`, `mergeByM`, `mergeAsyncBy`,
343 `mergeAsyncByM`, `isPrefixOf`, `isSubsequenceOf`, `stripPrefix`,
344 `concatMap`, `concatMapM`, `indexed`, `indexedR`
345* Following instances were added for `SerialT m`, `WSerialT m` and
346 `ZipSerialM m`:
347 * When `m` ~ `Identity`: IsList, Eq, Ord, Show, Read, IsString, NFData,
348 NFData1, Traversable
349 * When `m` is `Foldable`: Foldable
350* Performance improvements
351* Add benchmarks to measure composed and iterated operations
353## 0.5.2 (October 2018)
355### Bug Fixes
357* Cleanup any pending threads when an exception occurs.
358* Fixed a livelock in ahead style streams. The problem manifests sometimes when
359 multiple streams are merged together in ahead style and one of them is a nil
360 stream.
361* As per expected concurrency semantics each forked concurrent task must run
362 with the monadic state captured at the fork point. This release fixes a bug,
363 which, in some cases caused an incorrect monadic state to be used for a
364 concurrent action, leading to unexpected behavior when concurrent streams are
365 used in a stateful monad e.g. `StateT`. Particularly, this bug cannot affect
366 `ReaderT`.
368## 0.5.1 (September 2018)
370* Performance improvements, especially space consumption, for concurrent
371 streams
373## 0.5.0 (September 2018)
375### Bug Fixes
377* Leftover threads are now cleaned up as soon as the consumer is garbage
378 collected.
379* Fix a bug in concurrent function application that in certain cases would
380 unnecessarily share the concurrency state resulting in incorrect output
381 stream.
382* Fix passing of state across `parallel`, `async`, `wAsync`, `ahead`, `serial`,
383 `wSerial` combinators. Without this fix combinators that rely on state
384 passing e.g. `maxThreads` and `maxBuffer` won't work across these
385 combinators.
387### Enhancements
389* Added rate limiting combinators `rate`, `avgRate`, `minRate`, `maxRate` and
390 `constRate` to control the yield rate of a stream.
391* Add `foldl1'`, `foldr1`, `intersperseM`, `find`, `lookup`, `and`, `or`,
392 `findIndices`, `findIndex`, `elemIndices`, `elemIndex`, `init` to Prelude
394### Deprecations
396* The `Streamly.Time` module is now deprecated, its functionality is subsumed
397 by the new rate limiting combinators.
399## 0.4.1 (July 2018)
401### Bug Fixes
403* foldxM was not fully strict, fixed.
405## 0.4.0 (July 2018)
407### Breaking changes
409* Signatures of `zipWithM` and `zipAsyncWithM` have changed
410* Some functions in prelude now require an additional `Monad` constraint on
411 the underlying type of the stream.
413### Deprecations
415* `once` has been deprecated and renamed to `yieldM`
417### Enhancements
419* Add concurrency control primitives `maxThreads` and `maxBuffer`.
420* Concurrency of a stream with bounded concurrency when used with `take` is now
421 limited by the number of elements demanded by `take`.
422* Significant performance improvements utilizing stream fusion optimizations.
423* Add `yield` to construct a singleton stream from a pure value
424* Add `repeat` to generate an infinite stream by repeating a pure value
425* Add `fromList` and `fromListM` to generate streams from lists, faster than
426 `fromFoldable` and `fromFoldableM`
427* Add `map` as a synonym of fmap
428* Add `scanlM'`, the monadic version of scanl'
429* Add `takeWhileM` and `dropWhileM`
430* Add `filterM`
432## 0.3.0 (June 2018)
434### Breaking changes
436* Some prelude functions, to whom concurrency capability has been added, will
437 now require a `MonadAsync` constraint.
439### Bug Fixes
441* Fixed a race due to which, in a rare case, we might block indefinitely on
442 an MVar due to a lost wakeup.
443* Fixed an issue in adaptive concurrency. The issue caused us to stop creating
444 more worker threads in some cases due to a race. This bug would not cause any
445 functional issue but may reduce concurrency in some cases.
447### Enhancements
448* Added a concurrent lookahead stream type `Ahead`
449* Added `fromFoldableM` API that creates a stream from a container of monadic
450 actions
451* Monadic stream generation functions `consM`, `|:`, `unfoldrM`, `replicateM`,
452 `repeatM`, `iterateM` and `fromFoldableM` can now generate streams
453 concurrently when used with concurrent stream types.
454* Monad transformation functions `mapM` and `sequence` can now map actions
455 concurrently when used at appropriate stream types.
456* Added concurrent function application operators to run stages of a
457 stream processing function application pipeline concurrently.
458* Added `mapMaybe` and `mapMaybeM`.
460## 0.2.1 (June 2018)
462### Bug Fixes
463* Fixed a bug that caused some transformation ops to return incorrect results
464 when used with concurrent streams. The affected ops are `take`, `filter`,
465 `takeWhile`, `drop`, `dropWhile`, and `reverse`.
467## 0.2.0 (May 2018)
469### Breaking changes
470* Changed the semantics of the Semigroup instance for `InterleavedT`, `AsyncT`
471 and `ParallelT`. The new semantics are as follows:
472 * For `InterleavedT`, `<>` operation interleaves two streams
473 * For `AsyncT`, `<>` now concurrently merges two streams in a left biased
474 manner using demand based concurrency.
475 * For `ParallelT`, the `<>` operation now concurrently meges the two streams
476 in a fairly parallel manner.
478 To adapt to the new changes, replace `<>` with `serial` wherever it is used
479 for stream types other than `StreamT`.
481* Remove the `Alternative` instance. To adapt to this change replace any usage
482 of `<|>` with `parallel` and `empty` with `nil`.
483* Stream type now defaults to the `SerialT` type unless explicitly specified
484 using a type combinator or a monomorphic type. This change reduces puzzling
485 type errors for beginners. It includes the following two changes:
486 * Change the type of all stream elimination functions to use `SerialT`
487 instead of a polymorphic type. This makes sure that the stream type is
488 always fixed at all exits.
489 * Change the type combinators (e.g. `parallely`) to only fix the argument
490 stream type and the output stream type remains polymorphic.
492 Stream types may have to be changed or type combinators may have to be added
493 or removed to adapt to this change.
494* Change the type of `foldrM` to make it consistent with `foldrM` in base.
495* `async` is renamed to `mkAsync` and `async` is now a new API with a different
496 meaning.
497* `ZipAsync` is renamed to `ZipAsyncM` and `ZipAsync` is now ZipAsyncM
498 specialized to the IO Monad.
499* Remove the `MonadError` instance as it was not working correctly for
500 parallel compositions. Use `MonadThrow` instead for error propagation.
501* Remove Num/Fractional/Floating instances as they are not very useful. Use
502 `fmap` and `liftA2` instead.
504### Deprecations
505* Deprecate and rename the following symbols:
506 * `Streaming` to `IsStream`
507 * `runStreaming` to `runStream`
508 * `StreamT` to `SerialT`
509 * `InterleavedT` to `WSerialT`
510 * `ZipStream` to `ZipSerialM`
511 * `ZipAsync` to `ZipAsyncM`
512 * `interleaving` to `wSerially`
513 * `zipping` to `zipSerially`
514 * `zippingAsync` to `zipAsyncly`
515 * `<=>` to `wSerial`
516 * `<|` to `async`
517 * `each` to `fromFoldable`
518 * `scan` to `scanx`
519 * `foldl` to `foldx`
520 * `foldlM` to `foldxM`
521* Deprecate the following symbols for future removal:
522 * `runStreamT`
523 * `runInterleavedT`
524 * `runAsyncT`
525 * `runParallelT`
526 * `runZipStream`
527 * `runZipAsync`
529### Enhancements
530* Add the following functions:
531 * `consM` and `|:` operator to construct streams from monadic actions
532 * `once` to create a singleton stream from a monadic action
533 * `repeatM` to construct a stream by repeating a monadic action
534 * `scanl'` strict left scan
535 * `foldl'` strict left fold
536 * `foldlM'` strict left fold with a monadic fold function
537 * `serial` run two streams serially one after the other
538 * `async` run two streams asynchronously
539 * `parallel` run two streams in parallel (replaces `<|>`)
540 * `WAsyncT` stream type for BFS version of `AsyncT` composition
541* Add simpler stream types that are specialized to the IO monad
542* Put a bound (1500) on the output buffer used for asynchronous tasks
543* Put a limit (1500) on the number of threads used for Async and WAsync types
545## 0.1.2 (March 2018)
547### Enhancements
548* Add `iterate`, `iterateM` stream operations
550### Bug Fixes
551* Fixed a bug that caused unexpected behavior when `pure` was used to inject
552 values in Applicative composition of `ZipStream` and `ZipAsync` types.
554## 0.1.1 (March 2018)
556### Enhancements
557* Make `cons` right associative and provide an operator form `.:` for it
558* Add `null`, `tail`, `reverse`, `replicateM`, `scan` stream operations
559* Improve performance of some stream operations (`foldl`, `dropWhile`)
561### Bug Fixes
562* Fix the `product` operation. Earlier, it always returned 0 due to a bug
563* Fix the `last` operation, which returned `Nothing` for singleton streams
565## 0.1.0 (December 2017)
567* Initial release