[Haskell-cafe] getChar

Cetin Sert cetin.sert at gmail.com
Tue Mar 25 11:36:51 EDT 2008


Hi,

is there a version of getChar that doesn't buffer keyboard input until enter
is pressed?

specialReadln :: IO String
specialReadln = do c ← getChar
                   if c == '#'
                     then do return []
                     else do cs ← specialReadln
                             return (c:cs)

I want the input process to terminate when '#' or any other specific key has
been pressed.

Best Regards,
Cetin Sert
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080325/b97ba77b/attachment.htm


More information about the Haskell-Cafe mailing list