[Haskell-beginners] lazy IO by example

Tim Baumgartner baumgartner.tim at googlemail.com
Sat Feb 5 11:01:23 CET 2011

2011/2/5 Dean Herington <heringtonlacey at mindspring.com>

> In your simplified example, it suffices to wrap unsafeInterleaveIO around
> (mapM content ds).  In a more realistic case, you'd need to add some
> `unsafeInterleaveIO`s in `files` and `directories`, too.

Thanks a lot! Now it was easy to write a lazy findFiles.
Would one have to write down a lot in order to see "on paper" why the
original example was not lazy? If I coud do this, I might run into fewer
problems in the future.

> Dean
> P.S. You might also want to look into iteratees, which accomplish a similar
> goal in a more robust way.

Yes, I already looked over the article in Monad reader #16. But then I
thaught I will first gain more understanding of the traditional way and then
return to iteratees.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20110205/e570f2a7/attachment.htm>

More information about the Beginners mailing list