todos-0.5: Easy-to-use TODOs manager.

Todos.IO

Description

Wrapper to support unicode IO with GHC 6.10 and 6.12

Synopsis

Documentation

putStr :: String -> IO ()

Write a string to the standard output device (same as hPutStr stdout).

putStrLn :: String -> IO ()

The same as putStr, but adds a newline character.

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).

print :: Show a => a -> IO ()

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

Encode a string using encode and store the result in a String.

decodeString :: String -> String

Decode a string using decode using a String as input. | This is not safe but it is necessary if UTF-8 encoded text | has been loaded into a String prior to being decoded.