how to do lazy IO like getContents?

Nick Name nick.name at inwind.it
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.

V.



More information about the Haskell mailing list