CS223 Homework 6 Due Friday, 5/21/2010 1. [25] Prove monad rules are satisfied. Do the Exercise at the end of script18.txt that involves proving that the three example monads satisfy the monad laws. 2. [30] Output version of Input module in SML. Write an Output structure that defines output analogues of the types and functions in the structure Input (file input.sml). Also write an output version of the additional functionality provided by InputParsing. Finally, define an output version of the natList reader action that outputs a list of natural numbers. 3. [20] Translate Input to Haskell Translate the definitions in Input and InputParsing into Haskell. Can you define generic versions analagous to the InputFn functor in inputfn.sml? 4. [25] Haskell Input using the IO monad. Modify your Haskell definitions from Problem 3 to use the built-in IO monad instead of the reader monad.