The
getContents operation returns all user input as a single
string, which is read lazily as it is needed.
getContents is implemented as
hGetContents
stdin.
This operation may fail with the same errors as
hGetContents.
Examples
>>> getContents >>= putStr
> aaabbbccc :D
aaabbbccc :D
> I hope you have a great day
I hope you have a great day
> ^D
>>> getContents >>= print . length
> abc
> <3
> def ^D
11