Commit bafd0e28 authored by mnislaih's avatar mnislaih
Browse files

Test case for #1537

parent 3c2302ae
......@@ -14,3 +14,4 @@ test('rebindable4', normal, compile_and_run, [''])
test('rebindable5', normal, compile_and_run, [''])
test('rebindable6', normal, compile_and_run, [''])
test('rebindable7', normal, compile_and_run, [''])
test('rebindable8', expect_broken(1537), compile, [''])
\ No newline at end of file
{-# OPTIONS -fno-implicit-prelude -fglasgow-exts #-}
-- Trac #1537
module Foo where
import Prelude hiding (Monad(..))
class Bind m1 m2 m3 where
(>>=) :: m1 a -> (a -> m2 b) -> m3 b
class Return m where
return :: a -> m a
fail :: String -> m a
instance Bind Maybe [] [] where
Just x >>= f = f x
Nothing >>= f = []
instance Return [] where
return x = [x]
fail _ = []
should_compile :: [Int]
should_compile = do
a <- Just 1
[a]
\ No newline at end of file
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