Lazy IO and asynchronous callbacks?

Bulat Ziganshin bulat.ziganshin at gmail.com
Fri Jul 9 03:47:49 EDT 2010


Hello Evan,

Friday, July 9, 2010, 3:01:28 AM, you wrote:

> There may very well be a better way to do this, but it definitely
> feels better to me than relying on unsafeInterleaveIO magic.  Your
> chan reader has to be in IO, but that's as it should be and you can
> still pass the chunks off to pure functions.

unsafeInterleaveIO isn't magic, it's just a way to convert IO calls to
pure lazy list. one should look into getContents implementation

in this case longRunningReadOperation should read from the channel
when it needs more data

-- 
Best regards,
 Bulat                            mailto:Bulat.Ziganshin at gmail.com



More information about the Glasgow-haskell-users mailing list