Commit f59cbaff authored by Simon Peyton Jones's avatar Simon Peyton Jones

Test Trac #303

parent 3677fe42
{-# LANGUAGE NoImplicitPrelude #-}
-- Trac #303
module T where
import qualified Prelude as P
class IxMonad m where
return :: a -> m i i a
(>>=) :: m i j a -> (a -> m j k b) -> m i k b
(>>) :: m i j a -> m j k b -> m i k b
m >> n = m >>= \_ -> n
fail :: P.String -> m i j a
fail s = P.error s
data T a b c = T
instance IxMonad T where
return _ = T
m >>= f = T
fail _ = T
testM :: T (a,b) b a
testM = T
test1 = testM >>= \x -> return x
test2 = do
x <- testM
return x
......@@ -21,6 +21,8 @@ test('rebindable7', normal, compile_and_run, [''])
test('rebindable8', normal, compile, [''])
test('rebindable9', normal, compile, [''])
test('T303', normal, compile, [''])
# Tests from Oleg
test('DoRestrictedM', normal, compile, [''])
test('DoParamM', reqlib('mtl'), compile_fail, [''])
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment