summaryrefslogtreecommitdiff
path: root/testsuite/tests/warnings/should_compile/T11128b.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/warnings/should_compile/T11128b.hs')
-rw-r--r--testsuite/tests/warnings/should_compile/T11128b.hs64
1 files changed, 0 insertions, 64 deletions
diff --git a/testsuite/tests/warnings/should_compile/T11128b.hs b/testsuite/tests/warnings/should_compile/T11128b.hs
deleted file mode 100644
index 497927716c..0000000000
--- a/testsuite/tests/warnings/should_compile/T11128b.hs
+++ /dev/null
@@ -1,64 +0,0 @@
-{-# LANGUAGE DeriveFunctor #-}
-{-# OPTIONS_GHC -Wnoncanonical-monadfail-instances #-}
-
--- | Test noncanonical-monadfail-instances warnings
-module T11128b where
-
-import Control.Applicative as A
-import Control.Monad as M
-import Control.Monad.Fail as MF
-
-----------------------------------------------------------------------------
--- minimal definition
-
-data T0 a = T0 a deriving Functor
-
-instance A.Applicative T0 where
- pure = T0
- (<*>) = M.ap
-
-instance M.Monad T0 where
- (>>=) = undefined
-
-instance MF.MonadFail T0 where
- fail = error "fail"
-
-----------------------------------------------------------------------------
--- trigger all 2 warnings
-
-data T1 a = T1 a deriving Functor
-
-instance A.Applicative T1 where
- pure = return
- (<*>) = M.ap
- (*>) = (M.>>)
-
-instance M.Monad T1 where
- (>>=) = undefined
- return = T1
- (>>) = undefined
- fail = error "fail"
-
-instance MF.MonadFail T1 where
- fail = M.fail
-
-----------------------------------------------------------------------------
--- backward compat canonical definition
-
-data T2 a = T2 a deriving Functor
-
-instance Applicative T2 where
- pure = T2
- (<*>) = ap
- (*>) = undefined
-
-instance M.Monad T2 where
- (>>=) = undefined
- return = pure
- (>>) = (*>)
- fail = MF.fail
-
-instance MF.MonadFail T2 where
- fail = error "fail"
-
-----------------------------------------------------------------------------