summaryrefslogtreecommitdiff
path: root/testsuite/tests/typecheck/should_compile/Tc239_Help.hs
blob: c72acdfb1103cfe1c6acd9353fce39adc1c144ca (plain)
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