base-compat
Safe HaskellSafe-Inferred
LanguageHaskell2010

System.IO.Compat

Synopsis

Documentation

module System.IO

getContents' :: IO String #

The getContents' operation returns all user input as a single string, which is fully read before being returned

getContents' is implemented as hGetContents' stdin.

This operation may fail with the same errors as hGetContents'.

Examples

Expand
>>> getContents' >>= putStr
> aaabbbccc :D
> I hope you have a great day
aaabbbccc :D
I hope you have a great day
>>> getContents' >>= print . length
> abc
> <3
> def ^D
11

Since: base-4.15.0.0

hGetContents' :: Handle -> IO String #

The hGetContents' operation reads all input on the given handle before returning it as a String and closing the handle.

This is a strict version of hGetContents

Since: base-4.15.0.0

readFile' :: FilePath -> IO String #

The readFile' function reads a file and returns the contents of the file as a string.

This is identical to readFile, but the file is fully read before being returned, as with getContents'.

Since: base-4.15.0.0