[Haskell-cafe] Abstraction leak

David Roundy droundy at darcs.net
Fri Jun 29 15:55:37 EDT 2007


On Fri, Jun 29, 2007 at 07:39:28PM +0100, Andrew Coppin wrote:
> Now I have a problem. It's easy enough to pass the entire data stream 
> through an RLE decoder and feed that to the Huffman table deserialize 
> function, and it will give be back the table. But I now have *no clue* 
> where the table ends in the original stream!

Sounds to me like you want a parsing monad.  Generally, when you want
state, you want a monad, and the field of parsing monads is pretty mature.
You can either write up a monad of your own, or use one of the existing
ones (parsec, frisby, read).
-- 
David Roundy
Department of Physics
Oregon State University


More information about the Haskell-Cafe mailing list