summaryrefslogtreecommitdiff
path: root/testsuite/tests/rebindable
diff options
context:
space:
mode:
authorFumiaki Kinoshita <fumiexcel@gmail.com>2020-07-15 21:12:07 +0900
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-10-14 18:06:12 -0400
commite60ae8a38394370fd8818ad004a101466fc7d2dc (patch)
tree6eff280150db65ae373aba5d50f550180b99983b /testsuite/tests/rebindable
parentbf2411a3c198cb2df93a9e0aa0c3b8297f47058d (diff)
downloadhaskell-e60ae8a38394370fd8818ad004a101466fc7d2dc.tar.gz
Add -Wnoncanonical-{monad,monoid}-instances to standardWarnings
------------------------- Metric Decrease: T12425 Metric Increase: T17516 -------------------------
Diffstat (limited to 'testsuite/tests/rebindable')
-rw-r--r--testsuite/tests/rebindable/rebindable9.hs13
1 files changed, 6 insertions, 7 deletions
diff --git a/testsuite/tests/rebindable/rebindable9.hs b/testsuite/tests/rebindable/rebindable9.hs
index 53f408223f..0776e1da56 100644
--- a/testsuite/tests/rebindable/rebindable9.hs
+++ b/testsuite/tests/rebindable/rebindable9.hs
@@ -16,19 +16,18 @@ instance Prelude.Functor Identity where
fmap = liftM
instance Applicative Identity where
- pure = Prelude.return
+ pure = Identity
(<*>) = ap
instance Prelude.Monad Identity where
- return a = Identity a
m >>= k = k (runIdentity m)
-class Bind m1 m2 m3 | m1 m2 -> m3 where
+class Bind m1 m2 m3 | m1 m2 -> m3 where
(>>=) :: m1 a -> (a -> m2 b) -> m3 b
class Return m where
returnM :: a -> m a
- fail :: String -> m a
+ fail :: String -> m a
instance Bind Maybe [] [] where
Just x >>= f = f x
@@ -39,15 +38,15 @@ instance Functor a => Bind a Identity a where m >>= f = fmap (runIdentity . f)
instance Prelude.Monad m => Bind m m m where (>>=) = (Prelude.>>=)
-instance Return [] where
+instance Return [] where
returnM x = [x]
- fail _ = []
+ fail _ = []
return :: a -> Identity a
return = Prelude.return
should_compile :: [Int]
-should_compile = do
+should_compile = do
a <- Just 1
b <- [a*1,a*2]
return (b+1) \ No newline at end of file