summaryrefslogtreecommitdiff
path: root/testsuite/tests/mdo/should_compile/mdo002.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/mdo/should_compile/mdo002.hs')
-rw-r--r--testsuite/tests/mdo/should_compile/mdo002.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/tests/mdo/should_compile/mdo002.hs b/testsuite/tests/mdo/should_compile/mdo002.hs
index dc33595590..432825749d 100644
--- a/testsuite/tests/mdo/should_compile/mdo002.hs
+++ b/testsuite/tests/mdo/should_compile/mdo002.hs
@@ -4,10 +4,18 @@
module Main (main) where
+import Control.Monad
import Control.Monad.Fix
data X a = X a deriving Show
+instance Functor X where
+ fmap f (X a) = X (f a)
+
+instance Applicative X where
+ pure = return
+ (<*>) = ap
+
instance Monad X where
return = X
(X a) >>= f = f a