[Haskell-cafe] Read a single char

Donald Bruce Stewart dons at cse.unsw.edu.au
Mon Oct 23 20:00:08 EDT 2006


briqueabraque:
>   Hi,
> 
>   How can I read a single character from standard output? I would like 
> the user to press a single key and the reading function return 
> imediately after that key is pressed.

so you want a function of type:
    IO Char

asking Hoogle (http://haskell.org/hoogle) we get:
    Prelude.              getChar            :: IO Char
    IO.                   hGetChar           :: Handle -> IO Char

-- Don



More information about the Haskell-Cafe mailing list