The readFile function reads a file and returns the contents of the file as a string. The entire file is read strictly, as with getContents.
Moduletext-2.1.3Haskell2010
Data.Text.IO.Utf8
Efficient UTF-8 support for text I/O.
Unlike Data.Text.IO, these functions do not depend on the locale
and do not do line ending conversion.
- 12 values
- Packagetext-2.1.3
- Exports12
- LanguageHaskell2010
- LicenceBSD-2-Clause
- SourceUtf8.hs
File-at-a-time operations
3 declarationsWrite a string to a file. The file is truncated to zero length before writing begins.
Write a string to the end of a file.
Operations on handles
4 declarationsRead the remaining contents of a Handle as a string.
Read a single line from a handle.
Write a string to a handle.
Write a string to a handle, followed by a newline.
Special cases for standard input and output
5 declarationsThe interact function takes a function of type Text -> Text
as its argument. The entire input from the standard input device is
passed to this function as its argument, and the resulting string
is output on the standard output device.
Read all user input on stdin as a single string.
Read a single line of user input from stdin.
Write a string to stdout.
Write a string to stdout, followed by a newline.