streamly v0.7.0 Release Notes
Release Date: 2019-11-01 // about 4 years ago-
๐ฅ Breaking changes
- ๐ Change the signature of
foldrM
to ensure that it is lazy - ๐ Change the signature of
iterateM
to ensure that it is lazy. scanx
would now require an additionalMonad m
constraint.
Behavior change
- Earlier
ParallelT
was unaffected bymaxBuffer
directive, nowmaxBuffer
can limit the buffer of aParallelT
stream as well. When the buffer becomes full, the producer threads block. - 0๏ธโฃ
ParallelT
streams 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
:runStream
has been replaced bydrain
runN
has been replaced bydrainN
runWhile
has been replaced bydrainWhile
fromHandle
has been deprecated. Please useStreamly.FileSystem.Handle.read
,Streamly.Data.Unicode.Stream.decodeUtf8
andsplitOnSuffix
withStreamly.Data.Fold.toList
to split the stream to a stream ofString
separated by a newline.toHandle
has been deprecated. Please useintersperse
andconcatUnfold
to add newlines to a stream,Streamly.Data.Unicode.Stream.encodeUtf8
for encoding andStreamly.FileSystem.Handle.write
for writing to a file handle.- Deprecate
scanx
,foldx
,foldxM
,foldr1
- Remove deprecated APIs
foldl
,foldlM
- Replace deprecated API
scan
with a new signature, to scan using Fold.
In
Streamly
module:runStream
has 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
uniq
function 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
parallel
combinator. 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 likebefore
,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.Socket
provides socket based streaming network IO operations.๐
Streamly.Network.Inet.TCP
provides combinators to build Inet/TCP clients and servers.
Concurrent concatMap
The new
concatMapWith
inStreamly.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.Stream
module provides encoding/decoding of character streams and other character stream operations. - Arrays:
Streamly.Memory.Array
module provides arrays for efficient in-memory buffering and efficient interfacing with IO.
- Unicode Strings:
โ Add the following to
Streamly.Prelude
:unfold
,fold
,scan
andpostscan
concatUnfold
to concat a stream after unfolding each elementintervalsOf
andchunksOf
splitOn
,splitOnSuffix
,splitWithSuffix
, andwordsBy
groups
,groupsBy
andgroupsByRolling
postscanl'
andpostscanlM'
intersperse
intersperse an element in between consecutive elements in streamtrace
combinator maps a monadic function on a stream just for side effectstap
redirects a copy of the stream to aFold
- ๐ Change the signature of