Tc239_Help.hs 311 Bytes
Newer Older
Simon Peyton Jones's avatar
Simon Peyton Jones committed
1 2 3 4 5 6 7 8 9 10 11 12 13
module Tc239_Help ( WrapIO, WrapIO2 ) where

newtype WrapIO e a = MkWrapIO { unwrap :: IO a }

type WrapIO2 a = WrapIO String a

instance Monad (WrapIO e) where
  return x = MkWrapIO (return x)

  m >>= f  = MkWrapIO (do x <- unwrap m
                          unwrap (f x) )

  fail str = error str