[Haskell-beginners] Using the Get monad lazily

Daniel Fischer daniel.is.fischer at web.de
Sat Jul 17 08:10:33 EDT 2010


On Saturday 17 July 2010 05:49:47, MAN wrote:
> I'm sorry if this matter has already been discussed, but I'm going nuts
> here. Attached is the code for a small program, an ubber simplification
> of something I'm trying to do which would enormously gain from lazy
> serialization. The code, however, is broken... It runs, and does the
> job, but it does so strictly.

The Get monad has been made strict in binary-0.5.
If you need lazy behaviour, you can try binary-0.4.4 (or earlier), or you 
could write your own lazy Get-wrapper using runGetState (won't be too much 
fun).

HTH,
Daniel


More information about the Beginners mailing list