hGet -package:base

Read a ByteString directly from the specified Handle. This is far more efficient than reading the characters into a String and then using pack. First argument is the Handle to read from, and the second is the number of bytes to read. It returns the bytes read, up to n, or empty if EOF has been reached. hGet is implemented in terms of hGetBuf. If the handle is a pipe or socket, and the writing end is closed, hGet will behave as if EOF was reached.
Read n bytes into a ByteString, directly from the specified Handle.
Lifted hGet
Lifted hGet
Convert a handle into a byte stream using a fixed chunk size hGet waits until exactly the requested number of bytes are available for each chunk.
Read Bytes directly from the specified Handle. The resulting Bytes are pinned. This is implemented with hGetBuf.
Read n bytes into a ByteStream, directly from the specified Handle.
Read specified number of bytes. See hGet for particular semantics.
Read a Vector directly from the specified Handle. This is far more efficient than reading the characters into a list and then using pack.
Read binary data directly from the specified Handle. First argument is the Handle to read from, and the second is the number of bytes to read. It returns the bytes read, up to the specified size, or an empty array if EOF has been reached. hGet is implemented in terms of hGetBuf.
Gets any data from HSet for you
Heterogeneous read arbitrarily element from hset
>>> let x = HSCons (10 :: Int) $ HSCons (20 :: Double) HSNil

>>> x
HSCons (10) (HSCons (20.0) (HSNil))
>>> hget x :: Int
10
>>> hget x :: Double
20.0
Note that hget takes specific element from list of uniquely typed elements depending on what type is required to be returned (return type polymorphism)
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.
Deprecated: Deprecated since bytestring-0.12. Use hGetLine instead. (Functions that rely on ASCII encodings belong in Data.ByteString.Char8)
hGetNonBlocking is similar to hGet, except that it will never block waiting for data to become available, instead it returns only whatever data is available. If there is no data available to be read, hGetNonBlocking returns empty. Note: on Windows and with Haskell implementation other than GHC, this function does not work correctly; it behaves identically to hGet.
Like hGet, except that a shorter ByteString may be returned if there are not enough bytes immediately available to satisfy the whole request. hGetSome only blocks if there is no data available, and EOF has not yet been reached.
Read a line from a handle
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.
Experimental. Read a single chunk of strict text from a Handle. The size of the chunk depends on the amount of input currently buffered. This function blocks only if there is no data available, and EOF has not yet been reached. Once EOF is reached, this function returns an empty string instead of throwing an exception.
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.
Read a single line from a handle.
Read the remaining contents of a Handle as a string.