3 ms·
> Check out attoparsec-iteratee http://hackage.haskell.org/package/attoparsec-iteratee http://hackage.haskell.org/package/attoparsec-iteratee for an example of
by how_gauche 16y ago
> Check out attoparsec-iteratee http://hackage.haskell.org/package/attoparsec-iteratee http://hackage.haskell.org/package/attoparsec-iteratee for an example of iteratee usage: it turns a fast bytestring parser into one that's based on iteratees, which will probably end up being even faster.
Iteratees don't really make things "faster" (you end up with a sequence of imperative read()/write() calls just like everything else), but they allow you to stream in O(1) space while still being easily composable.
For example, we do gzip, buffering, & chunked transfer encoding using simple function calls, and we don't really have to worry about explicit buffer management or control flow while we're doing it.
- tumult 16y agoFixed, thanks!