import Data.Char main = do c <- getChar if not $ isUpper c then do putChar $ toUpper c main else putChar '\n'
Download and run in GHCi:
λ> :l foo.hs Ok, modules loaded: Main. λ> main ñÑsSjJ44aAtTR λ>
This time consumes one character.
But in the terminal:
[~ %]> runhaskell foo.hs utar,hkñm-Rjaer UTAR,HKÑM- [~ %]>
it consumes one row at a time.
Why does he behave differently?
helq
source share