I'm complete newbie on Haskell.
My Haskell script with GHCi
,
Prelude> let a = putStrLn getLine
makes an error like this.
<interactive>:1:17:
Couldn't match expected type `String'
against inferred type `IO String'
In the first argument of `putStrLn', namely `getLine'
In the expression: putStrLn getLine
In the definition of `a': a = putStrLn getLine
Prelude>
Why doesn't it work and how can I print something input from stdin
?