base: Remove `Monad(fail)` method and reexport `MonadFail(fail)` instead
[ghc.git] / testsuite / tests / rebindable / RebindableFailB.hs
1 -- Test that RebindableSyntax and the new MonadFail interact correctly.
2 --
3 -- This should print "Just ()"
4
5 {-# LANGUAGE RebindableSyntax #-}
6
7 import Prelude hiding (fail)
8
9 fail :: String -> a
10 fail _ = error "Failed with error"
11
12 f :: Maybe Int -> Maybe ()
13 f x = do
14 42 <- x
15 return ()
16 {-# NOINLINE f #-}
17
18 main = print (f (Just 42))
19
20