how to do lazy IO like getContents?

Nick Name at
Sun Oct 19 03:03:58 EDT 2003

Alle 01:50, domenica 19 ottobre 2003, Ben Escoto ha scritto:
> which only reads one character.  So how do you write getContents in
> haskell?  Thanks for any insight.

You have to use unsafeInterleaveIO, wich lazily defers the IO action 
passed as an argument. Look for this function in your documentation, 
both hugs and ghc have it.


More information about the Haskell mailing list