The Backpack patch.
[ghc.git] / testsuite / tests / monadfail / MonadFailWarningsDisabled.hs
1 -- Test purpose:
2 -- Make sure that not enabling MonadFail warnings makes code compile just
3 -- as it did in < 8.0
4
5 module MonadFailWarnings where
6
7 import Control.Monad.Fail
8 import Control.Monad.ST
9 import Data.Functor.Identity
10
11
12
13 general :: Monad m => m a
14 general = do
15 Just x <- undefined
16 undefined
17
18
19
20 general' :: MonadFail m => m a
21 general' = do
22 Just x <- undefined
23 undefined
24
25
26
27 identity :: Identity a
28 identity = do
29 Just x <- undefined
30 undefined
31
32
33
34 io :: IO a
35 io = do
36 Just x <- undefined
37 undefined
38
39
40
41 st :: ST s a
42 st = do
43 Just x <- undefined
44 undefined
45
46
47
48 reader :: r -> a
49 reader = do
50 Just x <- undefined
51 undefined
52
53
54
55 newtype Newtype a = Newtype a
56 newtypeMatch :: Identity a
57 newtypeMatch = do
58 Newtype x <- undefined
59 undefined
60
61
62
63 data Data a = Data a
64 singleConMatch :: Identity a
65 singleConMatch = do
66 Data x <- undefined
67 undefined
68
69
70
71 data Maybe' a = Nothing' | Just' a
72 instance Functor Maybe' where fmap = undefined
73 instance Applicative Maybe' where pure = undefined; (<*>) = undefined
74 instance Monad Maybe' where (>>=) = undefined
75 instance MonadFail Maybe' where fail = undefined
76 customFailable :: Maybe' a
77 customFailable = do
78 Just x <- undefined
79 undefined
80
81
82 wildcardx, explicitlyIrrefutable, wildcard_, tuple :: Monad m => m a
83 wildcardx = do
84 x <- undefined
85 undefined
86 explicitlyIrrefutable = do
87 ~(x:y) <- undefined
88 undefined
89 wildcard_ = do
90 _ <- undefined
91 undefined
92 tuple = do
93 (a,b) <- undefined
94 undefined