foldl-transduce: Transducers for foldl folds.

[ bsd3, control, library ] [ Propose Tags ]

Stateful transducers and streaming-preserving grouping operations for the folds in the foldl package.


[Skip to Readme]
Versions [faq] 0.0.1, 0.1.0.0, 0.1.0.1, 0.1.2.0, 0.1.2.1, 0.1.2.2, 0.1.2.3, 0.2.0.0, 0.2.1.0, 0.3.0.0, 0.4.0.0, 0.4.0.1, 0.4.1.0, 0.4.2.0, 0.4.3.0, 0.4.4.0, 0.4.5.0, 0.4.6.0, 0.4.7.0, 0.5.0.0, 0.5.1.0, 0.5.2.0, 0.6.0.0
Change log CHANGELOG
Dependencies base (==4.*), bifunctors (==5.*), bytestring (>=0.9.2.1 && <0.11), comonad (==4.*), containers (<0.6), foldl (>=1.1 && <2), semigroupoids (>=5.0), text (>=0.11.2.0 && <1.3), transformers (>=0.2.0.0 && <0.5) [details]
License BSD-3-Clause
Copyright 2015 Daniel Diaz
Author Daniel Diaz
Maintainer diaz_carrete@yahoo.com
Category Control
Bug tracker https://github.com/danidiaz/foldl-transduce/issues
Source repo head: git clone git@github.com:danidiaz/foldl-transduce.git
Uploaded by DanielDiazCarrete at Sat Aug 29 15:37:25 UTC 2015
Distributions NixOS:0.6.0.0
Downloads 5994 total (281 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs available [build log]
Last success reported on 2015-08-29 [all 1 reports]

Modules

[Index]

Downloads

Maintainer's Corner

For package maintainers and hackage trustees


Readme for foldl-transduce-0.2.1.0

[back to package description]

What's in this library?

Stateful transducers and streaming-preserving group operations for the folds in Gabriel Gonzalez's foldl package.

When to use this library?

  • When you want to wrap a stateful decoder over a Fold. An example is decoding UTF-8: the decoder must be stateful because a multi-byte character may have been split across two blocks of bytes.

  • When you want to tweak the stream of data that arrives into a Fold, but only at certain positions. Stripping whitespace at the beginning of a text stream, for example.

  • When you want to perform group operations without breaking "streaminess", similar to what pipes-group does.

Why use this library for grouping instead of pipes-group?

Grouping fold-side instead of producer-side has the advantage that, since the results are still Folds, you can combine them using Applicative.

Also, Folds can work with sources other than Producers from pipes.

Grouping fold-side has limitations as well:

  • You can't perform bracketing operations like "withFile" that span the folding of an entire group. pipes-group allows them.

  • There doesn't seem to be a way to just take the first N groups in a stream and afterwards rejoin them.

  • You have more flexibility in pipes-group to decide how to fold a group based on previous results.