Я полный новичок на Хаскеле.
Мой скрипт на Haskell с GHCi
,
Prelude> let a = putStrLn getLine
делает ошибку, подобную этой.
<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>
Почему не работает и как я могу напечатать что-нибудь из stdin
?