Update Trac ticket URLs to point to GitLab
[ghc.git] / testsuite / tests / rebindable / rebindable8.hs
1 {-# LANGUAGE RebindableSyntax, MultiParamTypeClasses #-}
2
3 -- #1537
4
5 module Foo where
6 import Prelude hiding (Monad(..))
7
8 class Bind m1 m2 m3 where
9 (>>=) :: m1 a -> (a -> m2 b) -> m3 b
10
11 class Return m where
12 return :: a -> m a
13 fail :: String -> m a
14
15 instance Bind Maybe [] [] where
16 Just x >>= f = f x
17 Nothing >>= f = []
18
19 instance Return [] where
20 return x = [x]
21 fail _ = []
22
23 should_compile :: [Int]
24 should_compile = do
25 a <- Just 1
26 [a]