Safe Haskell | Safe-Inferred |
---|
Wrapper to support unicode IO with GHC 6.10 and 6.12
Documentation
readFile :: FilePath -> IO String
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
.
getContents :: IO String
The getContents
operation returns all user input as a single string,
which is read lazily as it is needed
(same as hGetContents
stdin
).
The print
function outputs a value of any printable type to the
standard output device.
Printable types are those that are instances of class Show
; print
converts values to strings for output using the show
operation and
adds a newline.
For example, a program to print the first 20 integers and their powers of 2 could be written as:
main = print ([(n, 2^n) | n <- [0..19]])
encodeString :: String -> String
decodeString :: String -> String
ensureUnicode :: String -> StringSource