streamly
Streaming data pipelines with declarative concurrency
https://streamly.composewell.com
| LTS Haskell 24.16: | 0.10.1@rev:6 |
| Stackage Nightly 2025-10-24: | 0.11.0@rev:1 |
| Latest on Hackage: | 0.11.0@rev:1 |
streamly-0.11.0@sha256:4d748ea85e0a4a312d6ff35f7b18707d9ff4c35fea528959613b9e1b8cbf7bc0,21959Module documentation for 0.11.0
- Streamly
- Streamly.Data
- Streamly.Data.Array
- Streamly.Data.Fold
- Streamly.Data.Scanl
- Streamly.Data.Stream
- Streamly.Internal
- Streamly.Internal.Control
- Streamly.Internal.Data
- Streamly.Internal.Data.Atomics
- Streamly.Internal.Data.Channel
- Streamly.Internal.Data.Cont
- Streamly.Internal.Data.Fold
- Streamly.Internal.Data.IOFinalizer
- Streamly.Internal.Data.IsMap
- Streamly.Internal.Data.SVar
- Streamly.Internal.Data.Scanl
- Streamly.Internal.Data.Stream
- Streamly.Internal.Data.Stream.Ahead
- Streamly.Internal.Data.Stream.Async
- Streamly.Internal.Data.Stream.IsStream
- Streamly.Internal.Data.Stream.MkType
- Streamly.Internal.Data.Stream.Parallel
- Streamly.Internal.Data.Stream.Prelude
- Streamly.Internal.Data.Stream.SVar
- Streamly.Internal.Data.Stream.Serial
- Streamly.Internal.Data.Stream.Zip
- Streamly.Internal.Data.Stream.ZipAsync
- Streamly.Internal.Data.Unfold
- Streamly.Internal.Network
- Streamly.Internal.Network.Inet
- Streamly.Internal.Network.Socket
- Streamly.Internal.Unicode
- Streamly.Network
- Streamly.Network.Inet
- Streamly.Network.Socket
- Streamly.Prelude
- Streamly.Data
Streamly: Idiomatic Haskell with C-Like Performance
Upgrading to 0.9.0+
Please read the Streamly 0.9.0 Upgrade Guide.
Overview
Streamly is a powerful Haskell library that provides developers with the essential building blocks to create safe, scalable, modular, and high-performance software. With Streamly, developers can enjoy the benefits of Haskell’s type safety while leveraging C-like program performance. Streamly offers a comprehensive range of features, comprising:
- Haskell’s strong type safety.
- C-program-like performance capabilities.
- Flexible, modular building blocks.
- Idiomatic functional programming.
- Fearless, declarative concurrency for seamless parallel execution.
- A collection of ecosystem libraries for fast and efficient development.
Check out the Learn By Examples page for an introduction to the library. For more detailed documentation, visit the Haskell Streamly website.
Blazing Fast
Streamly delivers C-like speed in Haskell by fusing stream pipelines using the stream-fusion technique, resulting in compiled code that is equivalent to handwritten C code, eliminating intermediate allocations and function calls.
For a comprehensive comparison of Streamly to other Haskell streaming libraries, check out our streaming benchmarks page. In fact, Streamly’s fused loops can be up to 100 times faster than those of libraries without stream fusion.
Declarative Concurrency
Streamly introduces declarative concurrency to standard functional streaming abstractions. Declarative concurrency abstracts away the low-level details of concurrency management, such as locks and threads, and allows for easier and safer parallelization of code. For example, with Streamly you can do things like repeat actions concurrently to generate a stream of results, map functions concurrently on a stream, and combine multiple streams concurrently to create a single output stream.
Unified API
Streamly provides a comprehensive and unified API for basic programming needs, covering a wide range of areas including streaming, concurrency, logic programming, reactive programming, pinned and unpinned arrays, serialization, builders, parsers, unicode processing, file-io, file system events, and network-io. By unifying functionality from disparate Haskell libraries, Streamly simplifies development while delivering equivalent or improved performance. Additionally, the complexity of handling combinations of lazy, strict, bytestring, and text is eliminated by using streams for lazy evaluation, and by generalizing bytestring and text to arrays.
Check out Streamly’s documentation for more information about Streamly’s features.
Batteries Included
In addition to the fundamental programming constructs, Streamly also provides higher-level functionality through supporting packages such as streamly-process, streamly-shell, and streamly-coreutils that are essential for general programming tasks. Check out the streamly-examples repository for some program snippets.
Highly Modular
Traditionally, you must choose between modularity and performance when
writing code. However, with Haskell Streamly, you can have
the best of both worlds. By taking advantage of GHC’s stream fusion
optimizations (such as case-of-case and spec-constr), Streamly achieves
performance comparable to an equivalent C program while still allowing
for highly modular code.
Credits
The following authors/libraries have influenced or inspired this library in a significant way:
Please see the credits directory for a full
list of contributors, credits and licenses.
Licensing
Streamly is an open source project available under a liberal BSD-3-Clause license
Contributing to Streamly
As an open project we welcome contributions:
Getting Support
Professional support is available for Streamly: please contact [email protected].
You can also join our community chat channel on Gitter.
Changes
Changelog
0.11.0
See 0.10.1-0.11.0 API Changelog for detailed API changes in this release.
Breaking Changes
- Concurrent streams and folds now use separate concurrency config types. If you
were importing
Configfrom the wrong module, you will need to update it.
Enhancements
- Support for prompt cleanup of concurrent threads, allowing guaranteed cleanup as an alternative to GC-based cleanup.
- Introduced
Streamly.Data.Scanl.Preludefor using concurrent operations with the newScanltype. Scans can split a stream into multiple streams, process them concurrently, and merge the results. - Added new concurrent fold combinators in
Streamly.Data.Fold.Prelude. - Fixed rate control for ordered streams.
Internal
- Internal
FileSystem.Event.*modules are deprecated; use the streamly-fsevents package. instead.
0.10.1 (Jan 2024)
- Fix TH macros in
Streamly.Data.Stream.MkTypefor GHC 9.6 and above.
0.10.0 (Nov 2023)
See
0.9.0-0.10.0 API Changelog
for a full list of API changes in this release. Only a few significant
changes are mentioned here. For changes to the core functionality
please see the changelog of the streamly-core package.
Breaking Changes
MonadTransandMonadBaseinstances have been removed forAsyncT,ParallelT,AheadTfor GHC versions 9.6 onwards. This is due to a breaking change intransformers0.6. You can replaceliftwithfromEffectwhen using these as top level monads in a monad stack.
Enhancements
- Concurrent Folds:
Streamly.Data.Fold.Preludemodule added with concurrent fold APIs and a container fold API to fold a key value stream to a HashMap.
0.9.0 (Mar 2023)
Also see the following:
- streamly-0.9.0 Upgrade Guide or https://hackage.haskell.org/package/streamly-0.9.0/docs/docs/User/ProjectRelated/Upgrading.md
- streamly-0.9.0 API Changelog or https://hackage.haskell.org/package/streamly-0.9.0/docs/docs/User/ProjectRelated/ApiChangelogs/0.8.3-0.9.0.txt
- streamly-core-0.1.0 API Changelog or https://hackage.haskell.org/package/streamly-core-0.1.0/docs/docs/ApiChangelogs/0.1.0.txt
Package split
streamly package is split into two packages, (1) streamly-core that
has only GHC boot library depdendecies, and (2) streamly that contains
higher level operations (including concurrent ones) with additional
dependencies. Make sure you add a dependency on streamly-core to keep old
code working.
- Moved the following modules from
streamlypackage to thestreamly-corepackage:- Streamly.Console.Stdio
- Streamly.Data.Fold
- Streamly.Data.Unfold
- Streamly.FileSystem.Handle
- Streamly.Unicode.Stream
Breaking Changes
- Unboxed arrays now require
Unboxconstraint instead ofStorable. TheUnboxtypeclass can be imported fromStreamly.Data.Array. You can use generic deriving to derive Unbox instances. - Stream type in all modules has been changed to the new
Streamtype replacing the existingIsStream torSerialTtypes. UsefromStream,toStreamfromStreamly.Preludemodule to adapt the types. - Signatures changed in
Streamly.Data.Unfold:fromStreamreplicateM
Major Changes
Streamly.Prelude module has been deprecated, equivalent
functionality is covered by the Streamly.Data.Stream,
Streamly.Data.Stream.Prelude, and Streamly.Data.Fold modules. The
new modules use a monomorphic Stream type instead of the polymorphic
IsStream t type.
Streamly.Data.Stream module and the Stream type are meant for
writing high-performance fused pipelines not involving explicit
recursion. For writing code that may require recursive function calls,
Streamly.Data.Stream.StreamK module and the StreamK type have been
added which provide a CPS based stream implementation. Stream and
StreamK types can be easily interconverted.
The old code can be adapted to use the new modules with some changes. See the streamly-0.9.0 Upgrade Guide for more details on how to adapt your existing code to the new release.
Enhancements
- Added the following new modules to the
streamlypackage:- Streamly.Data.Stream.MkType
- Streamly.Data.Stream.Prelude
- Added the following new modules to the
streamly-corepackage:- Streamly.Data.Array
- Streamly.Data.Array.Generic
- Streamly.Data.MutArray
- Streamly.Data.MutArray.Generic
- Streamly.Data.Parser
- Streamly.Data.ParserK
- Streamly.Data.Stream
- Streamly.Data.StreamK
- Streamly.FileSystem.Dir
- Streamly.FileSystem.File
- Streamly.Unicode.Parser
- Streamly.Unicode.String
Deprecations
- Remove support for GHC 8.4.*
Several modules and functions have been deprecated, equivalent modules or functions are suggested in the deprecation warning messages by the compiler.
Internal module changes
If you cannot find an internal module that you were using, it may have
been moved to the streamly-core package or may have been renamed.
Following modules are moved to streamly-core package and renamed:
- Streamly.Internal.Data.Array.Stream.Foreign -> Streamly.Internal.Data.Stream.Chunked
- Streamly.Internal.Data.Array.Stream.Mut.Foreign -> Streamly.Internal.Data.Array.Mut.Stream
0.8.3 (September 2022)
- Fix build with GHC 9.4
0.8.2 (Mar 2022)
- Fix performance issues for GHC-9. These changes coupled with GHC changes expected to land in 9.2.2 will bring the performance back to the same levels as before.
0.8.1.1 (Dec 2021)
- Disable building FileSystem.Events where FS Events isn’t supported.
0.8.1 (Nov 2021)
See ApiChangelogs/0.8.0-0.8.1.txt for new APIs introduced.
Bug Fixes
- Several bug fixes in the Array module:
- Fix writeN fold eating away one element when applied multiple times #1258.
- Fix potentially writing beyond allocated memory when shrinking. Likely cause of #944.
- Fix potentially writing beyond allocated memory when writing the last element. Likely cause of #944.
- Fix missing pointer touch could potentially cause use of freed memory.
- Fix unnecessary additional allocation due to a bug
- Fix a bug in classifySessionsBy, see PR #1311. The bug could cause premature ejection of a session when input events with the same key are split into multiple sessions.
Notable Internal API Changes
tapAsyncfromStreamly.Internal.Data.Stream.Parallelhas been moved toStreamly.Internal.Data.Stream.IsStreamand renamed totapAsyncK.Fold2has now been renamed toRefoldand the correspondingFold2combinators have been either renamed or removed.
0.8.0 (Jun 2021)
See API Changelog for a complete list of signature changes and new APIs introduced.
Breaking changes
Streamly.Preludefold: this function may now terminate early without consuming the entire stream. For example,fold Fold.head streamwould now terminate immediately after consuming the head element fromstream. This may result in change of behavior in existing programs if the program relies on the evaluation of the full stream.
Streamly.Data.Unicode.Stream- The following APIs no longer throw errors on invalid input, use new
APIs suffixed with a prime for strict behavior:
- decodeUtf8
- encodeLatin1
- encodeUtf8
- The following APIs no longer throw errors on invalid input, use new
APIs suffixed with a prime for strict behavior:
Streamly.Data.Fold:- Several instances have been moved to the
Streamly.Data.Fold.Teemodule, please use theTeetype to adapt to the changes.
- Several instances have been moved to the
Bug Fixes
- Concurrent Streams: The monadic state for the stream is now propagated across threads. Please refer to #369 for more info.
Streamly.Prelude:bracket,handle, andfinallynow also work correctly on streams that aren’t fully drained. Also, the resource acquisition and release is atomic with respect to async exceptions.iterate,iterateMnow consume O(1) space instead of O(n).fromFoldableMis fixed to be concurrent.
Streamly.Network.Inet.TCP:acceptandconnectAPIs now close the socket if an exception is thrown.Streamly.Network.Socket:acceptnow closes the socket if an exception is thrown.
Enhancements
- See API Changelog for a complete list of new modules and APIs introduced.
- The Fold type is now more powerful, the new termination behavior allows to express basic parsing of streams using folds.
- Many new Fold and Unfold APIs are added.
- A new module for console IO APIs is added.
- Experimental modules for the following are added:
- Parsing
- Deserialization
- File system event handling (fsnotify/inotify)
- Folds for streams of arrays
- Experimental
use-c-mallocbuild flag to use the c librarymallocfor array allocations. This could be useful to avoid pinned memory fragmentation.
Notable Internal/Pre-release API Changes
Breaking changes:
- The
Foldtype has changed to accommodate terminating folds. - Rename:
Streamly.Internal.Prelude=>Streamly.Internal.Data.Stream.IsStream - Several other internal modules have been renamed and re-factored.
Bug fixes:
- A bug was fixed in the conversion of
MicroSecond64andMilliSecond64(commit e5119626) - Bug fix:
classifySessionsBynow flushes sessions at the end and terminates.
Miscellaneous
- Drop support for GHC 7.10.3.
- The examples in this package are moved to a new github repo streamly-examples
0.7.3 (February 2021)
Build Issues
- Fix build issues with primitive package version >= 0.7.1.
- Fix build issues on armv7.
0.7.2 (April 2020)
Bug Fixes
- Fix a bug in the
ApplicativeandFunctorinstances of theFolddata type.
Build Issues
- Fix a bug that occasionally caused a build failure on windows when
used with
stackorstack ghci. - Now builds on 32-bit machines.
- Now builds with
primitivepackage version >= 0.5.4 && <= 0.6.4.0 - Now builds with newer
QuickCheckpackage version >= 2.14 && < 2.15. - Now builds with GHC 8.10.
0.7.1 (February 2020)
Bug Fixes
- Fix a bug that caused
findIndicesto return wrong indices in some cases. - Fix a bug in
tap,chunksOfthat caused memory consumption to increase in some cases. - Fix a space leak in concurrent streams (
async,wAsync, andahead) that caused memory consumption to increase with the number of elements in the stream, especially when built with-threadedand used with-NRTS option. The issue occurs only in cases when a worker thread happens to be used continuously for a long time. - Fix scheduling of WAsyncT stream style to be in round-robin fashion.
- Now builds with
containerspackage version < 0.5.8. - Now builds with
networkpackage version >= 3.0.0.0 && < 3.1.0.0.
Behavior change
- Combinators in
Streamly.Network.Inet.TCPno longer use TCPNoDelayandReuseAddrsocket options by default. These options can now be specified using appropriate combinators.
Performance
- Now uses
fusion-pluginpackage for predictable stream fusion optimizations - Significant improvement in performance of concurrent stream operations.
- Improved space and time performance of
Foldableinstance.
0.7.0 (November 2019)
Breaking changes
- Change the signature of
foldrMto ensure that it is lazy - Change the signature of
iterateMto ensure that it is lazy. scanxwould now require an additionalMonad mconstraint.
Behavior change
- Earlier
ParallelTwas unaffected bymaxBufferdirective, nowmaxBuffercan limit the buffer of aParallelTstream as well. When the buffer becomes full, the producer threads block. ParallelTstreams no longer have an unlimited buffer by default. Now the buffer for parallel streams is limited to 1500 by default, the same as other concurrent stream types.
Deprecations
-
In
Streamly.Prelude:runStreamhas been replaced bydrainrunNhas been replaced bydrainNrunWhilehas been replaced bydrainWhilefromHandlehas been deprecated. Please useStreamly.FileSystem.Handle.read,Streamly.Data.Unicode.Stream.decodeUtf8andsplitOnSuffixwithStreamly.Data.Fold.toListto split the stream to a stream ofStringseparated by a newline.toHandlehas been deprecated. Please useintersperseandconcatUnfoldto add newlines to a stream,Streamly.Data.Unicode.Stream.encodeUtf8for encoding andStreamly.FileSystem.Handle.writefor writing to a file handle.- Deprecate
scanx,foldx,foldxM,foldr1 - Remove deprecated APIs
foldl,foldlM - Replace deprecated API
scanwith a new signature, to scan using Fold.
-
In
Streamlymodule:runStreamhas been deprecated, please useStreamly.Prelude.drain
-
Remove deprecated module
Streamly.Time(moved to Streamly.Internal.Data.Time) -
Remove module
Streamly.Internal(functionality moved to the Internal hierarchy)
Bug Fixes
- Fix a bug that caused
uniqfunction to yield the same element twice. - Fix a bug that caused “thread blocked indefinitely in an MVar operation” exception in a parallel stream.
- Fix unbounded memory usage (leak) in
parallelcombinator. The bug manifests when large streams are combined usingparallel.
Major Enhancements
This release contains a lot of new features and major enhancements. For more details on the new features described below please see the haddock docs of the modules on hackage.
Exception Handling
See Streamly.Prelude for new exception handling combinators like before,
after, bracket, onException, finally, handle etc.
Composable Folds
Streamly.Data.Fold module provides composable folds (stream consumers). Folds
allow splitting, grouping, partitioning, unzipping and nesting a stream onto
multiple folds without breaking the stream. Combinators are provided for
temporal and spatial window based fold operations, for example, to support
folding and aggregating data for timeout or inactivity based sessions.
Composable Unfolds
Streamly.Data.Unfold module provides composable stream generators. Unfolds allow
high performance merging/flattening/combining of stream generators.
Streaming File IO
Streamly.FileSystem.Handle provides handle based streaming file IO
operations.
Streaming Network IO
-
Streamly.Network.Socketprovides socket based streaming network IO operations. -
Streamly.Network.Inet.TCPprovides combinators to build Inet/TCP clients and servers.
Concurrent concatMap
The new concatMapWith in Streamly.Prelude combinator performs a
concatMap using a supplied merge/concat strategy. This is a very
powerful combinator as you can, for example, concat streams
concurrently using this.
Other Enhancements
-
Add the following new features/modules:
- Unicode Strings:
Streamly.Data.Unicode.Streammodule provides encoding/decoding of character streams and other character stream operations. - Arrays:
Streamly.Memory.Arraymodule provides arrays for efficient in-memory buffering and efficient interfacing with IO.
- Unicode Strings:
-
Add the following to
Streamly.Prelude:unfold,fold,scanandpostscanconcatUnfoldto concat a stream after unfolding each elementintervalsOfandchunksOfsplitOn,splitOnSuffix,splitWithSuffix, andwordsBygroups,groupsByandgroupsByRollingpostscanl'andpostscanlM'intersperseintersperse an element in between consecutive elements in streamtracecombinator maps a monadic function on a stream just for side effectstapredirects a copy of the stream to aFold
0.6.1 (March 2019)
Bug Fixes
- Fix a bug that caused
maxThreadsdirective to be ignored when rate control was not used.
Enhancements
- Add GHCJS support
- Remove dependency on “clock” package
0.6.0 (December 2018)
Breaking changes
Monadconstraint may be needed on some of the existing APIs (findIndicesandelemIndices).
Enhancements
- Add the following functions to Streamly.Prelude:
- Generation:
replicate,fromIndices,fromIndicesM - Enumeration:
Enumerabletype class,enumerateFrom,enumerateFromTo,enumerateFromThen,enumerateFromThenTo,enumerate,enumerateTo - Running:
runN,runWhile - Folds:
(!!),maximumBy,minimumBy,the - Scans:
scanl1', `scanl1M’ - Filters:
uniq,insertBy,deleteBy,findM - Multi-stream:
eqBy,cmpBy,mergeBy,mergeByM,mergeAsyncBy,mergeAsyncByM,isPrefixOf,isSubsequenceOf,stripPrefix,concatMap,concatMapM,indexed,indexedR
- Generation:
- Following instances were added for
SerialT m,WSerialT mandZipSerialM m:- When
m~Identity: IsList, Eq, Ord, Show, Read, IsString, NFData, NFData1, Traversable - When
misFoldable: Foldable
- When
- Performance improvements
- Add benchmarks to measure composed and iterated operations
0.5.2 (October 2018)
Bug Fixes
- Cleanup any pending threads when an exception occurs.
- Fixed a livelock in ahead style streams. The problem manifests sometimes when multiple streams are merged together in ahead style and one of them is a nil stream.
- As per expected concurrency semantics each forked concurrent task must run
with the monadic state captured at the fork point. This release fixes a bug,
which, in some cases caused an incorrect monadic state to be used for a
concurrent action, leading to unexpected behavior when concurrent streams are
used in a stateful monad e.g.
StateT. Particularly, this bug cannot affectReaderT.
0.5.1 (September 2018)
- Performance improvements, especially space consumption, for concurrent streams
0.5.0 (September 2018)
Bug Fixes
- Leftover threads are now cleaned up as soon as the consumer is garbage collected.
- Fix a bug in concurrent function application that in certain cases would unnecessarily share the concurrency state resulting in incorrect output stream.
- Fix passing of state across
parallel,async,wAsync,ahead,serial,wSerialcombinators. Without this fix combinators that rely on state passing e.g.maxThreadsandmaxBufferwon’t work across these combinators.
Enhancements
- Added rate limiting combinators
rate,avgRate,minRate,maxRateandconstRateto control the yield rate of a stream. - Add
foldl1',foldr1,intersperseM,find,lookup,and,or,findIndices,findIndex,elemIndices,elemIndex,initto Prelude
Deprecations
- The
Streamly.Timemodule is now deprecated, its functionality is subsumed by the new rate limiting combinators.
0.4.1 (July 2018)
Bug Fixes
- foldxM was not fully strict, fixed.
0.4.0 (July 2018)
Breaking changes
- Signatures of
zipWithMandzipAsyncWithMhave changed - Some functions in prelude now require an additional
Monadconstraint on the underlying type of the stream.
Deprecations
oncehas been deprecated and renamed toyieldM
Enhancements
- Add concurrency control primitives
maxThreadsandmaxBuffer. - Concurrency of a stream with bounded concurrency when used with
takeis now limited by the number of elements demanded bytake. - Significant performance improvements utilizing stream fusion optimizations.
- Add
yieldto construct a singleton stream from a pure value - Add
repeatto generate an infinite stream by repeating a pure value - Add
fromListandfromListMto generate streams from lists, faster thanfromFoldableandfromFoldableM - Add
mapas a synonym of fmap - Add
scanlM', the monadic version of scanl’ - Add
takeWhileManddropWhileM - Add
filterM
0.3.0 (June 2018)
Breaking changes
- Some prelude functions, to whom concurrency capability has been added, will
now require a
MonadAsyncconstraint.
Bug Fixes
- Fixed a race due to which, in a rare case, we might block indefinitely on an MVar due to a lost wakeup.
- Fixed an issue in adaptive concurrency. The issue caused us to stop creating more worker threads in some cases due to a race. This bug would not cause any functional issue but may reduce concurrency in some cases.
Enhancements
- Added a concurrent lookahead stream type
Ahead - Added
fromFoldableMAPI that creates a stream from a container of monadic actions - Monadic stream generation functions
consM,|:,unfoldrM,replicateM,repeatM,iterateMandfromFoldableMcan now generate streams concurrently when used with concurrent stream types. - Monad transformation functions
mapMandsequencecan now map actions concurrently when used at appropriate stream types. - Added concurrent function application operators to run stages of a stream processing function application pipeline concurrently.
- Added
mapMaybeandmapMaybeM.
0.2.1 (June 2018)
Bug Fixes
- Fixed a bug that caused some transformation ops to return incorrect results
when used with concurrent streams. The affected ops are
take,filter,takeWhile,drop,dropWhile, andreverse.
0.2.0 (May 2018)
Breaking changes
-
Changed the semantics of the Semigroup instance for
InterleavedT,AsyncTandParallelT. The new semantics are as follows:- For
InterleavedT,<>operation interleaves two streams - For
AsyncT,<>now concurrently merges two streams in a left biased manner using demand based concurrency. - For
ParallelT, the<>operation now concurrently meges the two streams in a fairly parallel manner.
To adapt to the new changes, replace
<>withserialwherever it is used for stream types other thanStreamT. - For
-
Remove the
Alternativeinstance. To adapt to this change replace any usage of<|>withparallelandemptywithnil. -
Stream type now defaults to the
SerialTtype unless explicitly specified using a type combinator or a monomorphic type. This change reduces puzzling type errors for beginners. It includes the following two changes:- Change the type of all stream elimination functions to use
SerialTinstead of a polymorphic type. This makes sure that the stream type is always fixed at all exits. - Change the type combinators (e.g.
parallely) to only fix the argument stream type and the output stream type remains polymorphic.
Stream types may have to be changed or type combinators may have to be added or removed to adapt to this change.
- Change the type of all stream elimination functions to use
-
Change the type of
foldrMto make it consistent withfoldrMin base. -
asyncis renamed tomkAsyncandasyncis now a new API with a different meaning. -
ZipAsyncis renamed toZipAsyncMandZipAsyncis now ZipAsyncM specialized to the IO Monad. -
Remove the
MonadErrorinstance as it was not working correctly for parallel compositions. UseMonadThrowinstead for error propagation. -
Remove Num/Fractional/Floating instances as they are not very useful. Use
fmapandliftA2instead.
Deprecations
- Deprecate and rename the following symbols:
StreamingtoIsStreamrunStreamingtorunStreamStreamTtoSerialTInterleavedTtoWSerialTZipStreamtoZipSerialMZipAsynctoZipAsyncMinterleavingtowSeriallyzippingtozipSeriallyzippingAsynctozipAsyncly<=>towSerial<|toasynceachtofromFoldablescantoscanxfoldltofoldxfoldlMtofoldxM
- Deprecate the following symbols for future removal:
runStreamTrunInterleavedTrunAsyncTrunParallelTrunZipStreamrunZipAsync
Enhancements
- Add the following functions:
consMand|:operator to construct streams from monadic actionsonceto create a singleton stream from a monadic actionrepeatMto construct a stream by repeating a monadic actionscanl'strict left scanfoldl'strict left foldfoldlM'strict left fold with a monadic fold functionserialrun two streams serially one after the otherasyncrun two streams asynchronouslyparallelrun two streams in parallel (replaces<|>)WAsyncTstream type for BFS version ofAsyncTcomposition
- Add simpler stream types that are specialized to the IO monad
- Put a bound (1500) on the output buffer used for asynchronous tasks
- Put a limit (1500) on the number of threads used for Async and WAsync types
0.1.2 (March 2018)
Enhancements
- Add
iterate,iterateMstream operations
Bug Fixes
- Fixed a bug that caused unexpected behavior when
purewas used to inject values in Applicative composition ofZipStreamandZipAsynctypes.
0.1.1 (March 2018)
Enhancements
- Make
consright associative and provide an operator form.:for it - Add
null,tail,reverse,replicateM,scanstream operations - Improve performance of some stream operations (
foldl,dropWhile)
Bug Fixes
- Fix the
productoperation. Earlier, it always returned 0 due to a bug - Fix the
lastoperation, which returnedNothingfor singleton streams
0.1.0 (December 2017)
- Initial release