summaryrefslogtreecommitdiff
path: root/testsuite/tests/monadfail/MonadFailWarningsDisabled.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/monadfail/MonadFailWarningsDisabled.hs')
-rw-r--r--testsuite/tests/monadfail/MonadFailWarningsDisabled.hs94
1 files changed, 94 insertions, 0 deletions
diff --git a/testsuite/tests/monadfail/MonadFailWarningsDisabled.hs b/testsuite/tests/monadfail/MonadFailWarningsDisabled.hs
new file mode 100644
index 0000000000..d3df107a4a
--- /dev/null
+++ b/testsuite/tests/monadfail/MonadFailWarningsDisabled.hs
@@ -0,0 +1,94 @@
+-- Test purpose:
+-- Make sure that not enabling MonadFail warnings makes code compile just
+-- as it did in < 8.0
+
+module MonadFailWarnings where
+
+import Control.Monad.Fail
+import Control.Monad.ST
+import Data.Functor.Identity
+
+
+
+general :: Monad m => m a
+general = do
+ Just x <- undefined
+ undefined
+
+
+
+general' :: MonadFail m => m a
+general' = do
+ Just x <- undefined
+ undefined
+
+
+
+identity :: Identity a
+identity = do
+ Just x <- undefined
+ undefined
+
+
+
+io :: IO a
+io = do
+ Just x <- undefined
+ undefined
+
+
+
+st :: ST s a
+st = do
+ Just x <- undefined
+ undefined
+
+
+
+reader :: r -> a
+reader = do
+ Just x <- undefined
+ undefined
+
+
+
+newtype Newtype a = Newtype a
+newtypeMatch :: Identity a
+newtypeMatch = do
+ Newtype x <- undefined
+ undefined
+
+
+
+data Data a = Data a
+singleConMatch :: Identity a
+singleConMatch = do
+ Data x <- undefined
+ undefined
+
+
+
+data Maybe' a = Nothing' | Just' a
+instance Functor Maybe' where fmap = undefined
+instance Applicative Maybe' where pure = undefined; (<*>) = undefined
+instance Monad Maybe' where (>>=) = undefined
+instance MonadFail Maybe' where fail = undefined
+customFailable :: Maybe' a
+customFailable = do
+ Just x <- undefined
+ undefined
+
+
+wildcardx, explicitlyIrrefutable, wildcard_, tuple :: Monad m => m a
+wildcardx = do
+ x <- undefined
+ undefined
+explicitlyIrrefutable = do
+ ~(x:y) <- undefined
+ undefined
+wildcard_ = do
+ _ <- undefined
+ undefined
+tuple = do
+ (a,b) <- undefined
+ undefined