The streaming-eversion package

[Tags:bsd3, library, test]

Translate pull-based folds from the "streaming" package into push-based folds from the "foldl" package.


[Skip to Readme]

Properties

Versions 0.1.0.0, 0.2.0.0, 0.3.0.0, 0.3.0.1, 0.3.1.0, 0.3.1.1
Change log CHANGELOG
Dependencies base (>=4.8 && <5), foldl (>=1.1.5), pipes (>=4.1.0), streaming (>=0.1.4.2), transformers (>=0.4.0.0) [details]
License BSD3
Copyright 2016 Daniel Diaz
Author Daniel Diaz
Maintainer diaz_carrete@yahoo.com
Category Control
Bug tracker https://github.com/danidiaz/streaming-eversion/issues
Source repository head: git clone git@github.com:danidiaz/streaming-eversion.git
Uploaded Wed Mar 8 22:16:23 UTC 2017 by DanielDiazCarrete
Updated Fri Apr 7 15:39:11 UTC 2017 by DanielDiazCarrete to revision 1
Distributions NixOS:0.3.1.1
Downloads 333 total (24 in the last 30 days)
Votes
0 []
Status Docs available [build log]
Last success reported on 2017-03-08 [all 1 reports]
Hackage Matrix CI

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees

Readme for streaming-eversion

Readme for streaming-eversion-0.3.1.1

What's in this library?

Functions that turn pull-based stream operations from the pipes/streaming ecosystem into push-based, iteratee-like stream operations. Inspired by the blog post Programmatic translation to iteratees from pull-based code.

Could you go into more detail?

There are three streaming libraries that often go together: pipes, streaming, and foldl. Of these, the first two are pull-based: you take some (possibly effectful) source of values and keep extracting stuff until the source is exhausted and/or you have obtained all the info you need. Meanwhile, foldl is push-based: foldl folds are not directly aware of any source, they are like little state machines that keep running as long as someone feeds them input. Usually, defining stream transformations in pull-based mode is easier and feels more natural. The pipes ecosystem already provides a lot of them: parsers, decoders, splitters. However, push-based mode also has advantages. Push-based abstractions are not tied to a particular type of source because data is fed externally. And foldl folds have very useful Applicative and Comonad instances. Also, sometimes a library will only offer a push-based interface. Wouldn't it be nice if you could adapt already existing pull-based operations to work on push-based consumers? For example, using a decoding function from Pipes.Text.Encoding to preprocess the inputs of a Fold. This library provides that.