summaryrefslogtreecommitdiff
path: root/testsuite/tests/polykinds/MonoidsTF.hs
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/tests/polykinds/MonoidsTF.hs')
-rw-r--r--testsuite/tests/polykinds/MonoidsTF.hs6
1 files changed, 5 insertions, 1 deletions
diff --git a/testsuite/tests/polykinds/MonoidsTF.hs b/testsuite/tests/polykinds/MonoidsTF.hs
index f289912ec6..9097e53af2 100644
--- a/testsuite/tests/polykinds/MonoidsTF.hs
+++ b/testsuite/tests/polykinds/MonoidsTF.hs
@@ -12,7 +12,7 @@
{-# LANGUAGE TypeFamilies #-}
module Main where
-import Control.Monad (Monad(..), join)
+import Control.Monad (Monad(..), join, ap, liftM)
import Data.Monoid (Monoid(..))
-- First we define the type class Monoidy:
@@ -96,6 +96,10 @@ instance (MId (→) m ~ (), MComp (→) m ~ (,), Monoidy (→) m)
mempty = munit ()
mappend = curry mjoin
+instance Applicative Wrapper where
+ pure = return
+ (<*>) = ap
+
instance Monad Wrapper where
return x = runNT munit $ Id x
x >>= f = runNT mjoin $ FC (f `fmap` x)