-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Skeleton library around the IO monad.
--   
--   A skeleton library to help learners of Haskell concentrate on the
--   pure-functional aspect and let the IO be handled by the library.
@package io-manager
@version 0.1.0.2


-- | A skeleton library to help learners of Haskell concentrate on the
--   pure-functional aspect and let the IO be handled by the library.
module Training.MM.IOManager

-- | Type of filenames.
type Filename = String

-- | Type of values holding inputs to the program, grouped by input source.
data Input

-- | Type of values holding outputs of the program, grouped by output
--   source.
data Output

-- | Wraps a simple function <tt>Input</tt> -&gt; <tt>Output</tt> -&gt;
--   <tt>Output</tt> in order to simplify student's usage.
wrapIO :: (Input -> Output -> Output) -> IO ()

-- | Obtains the contents of the standard input as given to the program.
--   Returns a String containing the input without any modification.
getStdIn :: Input -> String

-- | Obtains the contents of an input file. Returns a String containing the
--   input without any modification.
getInputFile :: Input -> Filename -> String

-- | Appends text to the standard output. No newline is printed at the end,
--   the caller must handle it. Returns a new <tt>Output</tt> value,
--   containing the appended text.
writeStdOut :: Output -> String -> Output

-- | Appends text to the standard error. No newline is printed at the end,
--   the caller must handle it. Returns a new <tt>Output</tt> value,
--   containing the appended text.
--   
--   Note: When running the program, the standard error text is displayed
--   after the entire text from the standard input is displayed.
writeStdErr :: Output -> String -> Output

-- | Appends to an output file. If the file does not exist in the
--   <tt>Output</tt> value (this program didn't yet write in it), it is
--   created as a new one. Returns a new <tt>Output</tt> value, containing
--   the appended text.
writeOutputFile :: Output -> Filename -> String -> Output
