The
readFile function reads a file and returns the contents of
the file as a string.
The file is read lazily, on demand, as with
getContents.
This operation may fail with the same errors as
hGetContents
and
openFile.
Examples
>>> readFile "~/hello_world"
"Greetings!"
>>> take 5 <$> readFile "/dev/zero"
"\NUL\NUL\NUL\NUL\NUL"