Hoogle Search
Within LTS Haskell 24.9 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
hGetContents' :: Handle -> IO Stringbase GHC.IO.Handle The hGetContents' operation reads all input on the given handle before returning it as a String and closing the handle.
hGetContents :: Handle -> IO Stringbase GHC.IO.Handle.Text 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.
- isEOFError if the end of file has been reached.
hGetContents' :: Handle -> IO Stringbase GHC.IO.Handle.Text The hGetContents' operation reads all input on the given handle before returning it as a String and closing the handle.
hGetContents :: Handle -> IO ByteStringbytestring Data.ByteString 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.
hGetContents :: Handle -> IO ByteStringbytestring Data.ByteString.Char8 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.
hGetContents :: Handle -> IO ByteStringbytestring Data.ByteString.Lazy 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.
hGetContents :: Handle -> IO ByteStringbytestring Data.ByteString.Lazy.Char8 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.
hGetContents :: Handle -> IO Texttext Data.Text.IO 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.
hGetContents :: Handle -> IO Texttext Data.Text.IO.Utf8 Read the remaining contents of a Handle as a string.
hGetContents :: Handle -> IO Texttext Data.Text.Lazy.IO Lazily read the remaining contents of a Handle. The Handle will be closed after the read completes, or on error.