fork download
  1. import Control.Monad.Writer
  2.  
  3. fun :: Int -> Writer [String] Int
  4. fun a = writer (a + 1, ["Increment"])
  5.  
  6. getValue :: Writer [String] Int -> Int
  7. getValue = fst $ runWriter
  8.  
  9. main :: IO ()
  10. main = print $ runWriter $ return 1 >>= fun >>= fun
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.hs:1:7:
    Could not find module `Control.Monad.Writer':
      Use -v to see a list of the files searched for.
stdout
Standard output is empty