getContents

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
getContents. Read stdin strictly. Equivalent to hGetContents stdin The Handle is closed after the contents have been read.
getContents. Equivalent to hGetContents stdin. Will read lazily
Read all user input on stdin as a single string.
Read all user input on stdin as a single string.
Lazily read all user input on stdin as a single string.
Receive data from the socket. The socket must be in a connected state. Data is received on demand, in chunks; each chunk will be sized to reflect the amount of data received by individual recv calls. All remaining data from the socket is consumed. When there is no more data to be received, the receiving side of the socket is shut down. If there is an error and an exception is thrown, the socket is not shut down.
The getContents operation returns all user input as a single string, which is read lazily as it is needed (same as hGetContents stdin).
The getContents operation returns all user input as a single string, which is read stirctly (same as hGetContents stdin).
Lifted getContents
Lifted getContents
Read all input from stdin into a lazy Text (LText) Uses system locale settings
Equivalent to hGetContents stdin. Will read lazily.
Read entire content from stdin. See hGetContents.
Read all user input on stdin as a single string
The getContents' operation returns all user input as a single string, which is fully read before being returned getContents' is implemented as hGetContents' stdin. This operation may fail with the same errors as hGetContents'.

Examples

>>> getContents' >>= putStr
> aaabbbccc :D
> I hope you have a great day
aaabbbccc :D
I hope you have a great day
>>> getContents' >>= print . length
> abc
> <3
> def ^D
11
The getContents' operation returns all user input as a single string, which is fully read before being returned (same as hGetContents' stdin).