[Haskell-cafe] generic putback

Sergey Mironov ierton at gmail.com
Sun May 15 16:33:51 CEST 2011


Hi Cafe. I wonder if it is possible to write a IO putback function
with following interface

putback :: a -> IO a -> IO a
putback x io = ???


where io is some action like reading from file or socket.
I want putback to build new action which will return x on first call,
and continue executing io after that.

Thanks in advance!
Sergey.



More information about the Haskell-Cafe mailing list