[Haskell-cafe] Monadic style with Streams (as in Data.Array.Parallel.Stream)

Stephen Tetley stephen.tetley at gmail.com
Sun May 16 03:27:18 EDT 2010


Hi Mark

What style of "Stream programming" do you have in mind? In Haskell
there can be at least four styles of Stream programming depending how
you count:

There is the stream as infinite-list - see Wouter Swierstra's
Data.Stream on Hackage and if you have university affiliation look for
the paper "Functional Pearl: Streams and Unique Fixed Points" by Ralf
Hinze. I think comonadic stream programming is within this style - if
not that makes five styles...

There's "Stream fusion" (Duncan Coutts, Roman Leshchinskiy, Don
Stewart) where the stream programming is an implementation technique
for particular data-structures - internally recursion is avoided with
a special unfold to get fusion optimizations.

Then there is the Arrow Stream processor style of writing transducers,
used I think by the Fudgets toolkit - streamproc on Hackage.

Possibly not finally, there is Jeremy Gibbons's 'Streaming
representation-changers' style which has relation to the Stream fusion
style but appears to have different aims - see "Arithmetic coding with
folds and unfolds" with Richard Bird.


None of them are monadic I'm afraid. The "Arithmetic coding..." paper
might be relevant if you are working with Huffman coding.

http://www.cse.unsw.edu.au/~dons/papers/stream-fusion.pdf
http://www.comlab.ox.ac.uk/jeremy.gibbons/publications/

Best wishes

Stephen


More information about the Haskell-Cafe mailing list