Write a string to a file. The file is truncated to zero length before writing begins.
Modulerebase-1.21.2Haskell2010
Rebase.Data.Text.IO
- 13 values
- Packagerebase-1.21.2
- Exports13
- LanguageHaskell2010
- LicenceMIT
- SourceIO.hs
Write a string to the end of a file.
Read all user input on stdin as a single string.
Read a single line of user input from stdin.
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.
Write a string to a handle.
The 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.
Write a string to stdout.
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.
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.
Write a string to a handle, followed by a newline.
Write a string to stdout, followed by a newline.
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.