getContents package:bytestring

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 a handle's entire contents strictly into a ByteString. This function reads chunks at a time, increasing the chunk size on each read. The final string is then reallocated to the appropriate size. For files > half of available memory, this may lead to memory exhaustion. Consider using readFile in this case. The Handle is closed once the contents have been read, or if an exception is thrown.
Read entire handle contents lazily into a ByteString. Chunks are read on demand, using the default chunk size. File handles are closed on EOF if all the file is read, or through garbage collection otherwise.