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 additional Monad m constraint.

    Behavior change

    • Earlier ParallelT was unaffected by maxBuffer directive, now maxBuffer can limit the buffer of a ParallelT 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 by drain
      • runN has been replaced by drainN
      • runWhile has been replaced by drainWhile
      • fromHandle has been deprecated. Please use, Streamly.Data.Unicode.Stream.decodeUtf8 and splitOnSuffix with Streamly.Data.Fold.toList to split the stream to a stream of String separated by a newline.
      • toHandle has been deprecated. Please use intersperse and concatUnfold to add newlines to a stream, Streamly.Data.Unicode.Stream.encodeUtf8 for encoding and Streamly.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 use Streamly.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 using parallel.

    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.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 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.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.
    • โž• Add the following to Streamly.Prelude:

      • unfold, fold, scan and postscan
      • concatUnfold to concat a stream after unfolding each element
      • intervalsOf and chunksOf
      • splitOn, splitOnSuffix, splitWithSuffix, and wordsBy
      • groups, groupsBy and groupsByRolling
      • postscanl' and postscanlM'
      • intersperse intersperse an element in between consecutive elements in stream
      • trace combinator maps a monadic function on a stream just for side effects
      • tap redirects a copy of the stream to a Fold