[Haskell-cafe] Fun with the ST monad

Alexander Solla alex.solla at gmail.com
Thu Feb 24 21:57:07 CET 2011


On Thu, Feb 24, 2011 at 12:45 PM, Andrew Coppin <andrewcoppin at btinternet.com
> wrote:

>
>
> Ah, yes, well there is one *small* problem... If you do that, the function
> becomes too strict.
>
> The input list is being read from disk by lazy I/O. With the original
> implementation, the input file gets read at the same time as the output file
> is written. But runST returns nothing until the *entire* input has been
> compressed. So writing to disk doesn't start until the entire file has been
> slurped up into memory.
>
> Anybody have any hints on how to get around this?
>

Use a lazy state monad?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20110224/e6e39030/attachment.htm>


More information about the Haskell-Cafe mailing list