Read a file and return its contents as a string. The file is read lazily, as with getContents.
Beware that this function (similarly to readFile) is locale-dependent. Unexpected system locale may cause your application to read corrupted data or throw runtime exceptions about "invalid argument (invalid byte sequence)" or "invalid argument (invalid character)". This is also slow, because GHC first converts an entire input to UTF-32, which is afterwards converted to UTF-8.
If your data is UTF-8, using decodeUtf8 . readFile is a much faster and safer alternative.