getContents

The getContents operation returns all user input as a single string, which is read lazily as it is needed (same as hGetContents stdin).
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.
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 stirctly (same as hGetContents stdin).
Lifted getContents
Lifted getContents
Read all input from stdin into a lazy Text (LText) Uses system locale settings
Read entire content from stdin. See hGetContents.
Equivalent to hGetContents stdin. Will read lazily.
The getContents' operation returns all user input as a single string, which is fully read before being returned (same as hGetContents' stdin).
Read stdin as UTF8-encoded Text value.
Computation hGetContents hdl returns the list of characters corresponding to the unread portion of the channel or file managed by hdl, which is put into an intermediate state, semi-closed. In this state, hdl is effectively closed, but items are read from hdl on demand and accumulated in a special list returned by hGetContents hdl. Any operation that fails because a handle is closed, also fails if a handle is semi-closed. The only exception is hClose. A semi-closed handle becomes closed:
  • if hClose is applied to it;
  • if an I/O error occurs when reading an item from the handle;
  • or once the entire contents of the handle has been read.
Once a semi-closed handle becomes closed, the contents of the associated list becomes fixed. The contents of this final list is only partially specified: it will contain at least all the items of the stream that were evaluated prior to the handle becoming closed. Any I/O errors encountered while a handle is semi-closed are simply discarded. This operation may fail with:
The hGetContents' operation reads all input on the given handle before returning it as a String and closing the handle.
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.
Read the remaining contents of a Handle as a string. The Handle is closed once the contents have been read, or if an exception is thrown. Internally, this function reads a chunk at a time from the lower-level buffering abstraction, and concatenates the chunks into a single string once the entire file has been read. As a result, it requires approximately twice as much memory as its result to construct its result. For files more than a half of available RAM in size, this may result in memory exhaustion.
Lazily read the remaining contents of a Handle. The Handle will be closed after the read completes, or on error.
Optional in-memory buffer containing the source code GHC should use for this target instead of reading it from disk. Since GHC version 8.10 modules which require preprocessors such as Literate Haskell or CPP to run are also supported. If a corresponding source file does not exist on disk this will result in a SourceError exception if targetId = TargetModule _ is used. However together with targetId = TargetFile _ GHC will not complain about the file missing.