aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Luposchainsky <dluposchainsky@gmail.com>2013-09-06 19:47:22 +0200
committerAustin Seipp <aseipp@pobox.com>2013-09-08 07:27:28 -0500
commite72cc68ad7be37948621ec3006f29d9d2e0cc365 (patch)
treecca06e5ec327b464339d30dd74f788dc712b11d9 /src
parent489d95b9603c1f34575a67b2d1f069e80769d59a (diff)
Fix AMP warnings
Signed-off-by: Austin Seipp <aseipp@pobox.com>
Diffstat (limited to 'src')
-rw-r--r--src/Haddock/Types.hs8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs
index bd4f10fa..19a6c90b 100644
--- a/src/Haddock/Types.hs
+++ b/src/Haddock/Types.hs
@@ -30,6 +30,8 @@ import qualified Data.Map as Map
import Data.Monoid
import GHC hiding (NoLink)
import OccName
+import Control.Applicative (Applicative(..))
+import Control.Monad (ap)
-----------------------------------------------------------------------------
@@ -493,6 +495,9 @@ newtype ErrMsgM a = Writer { runWriter :: (a, [ErrMsg]) }
instance Functor ErrMsgM where
fmap f (Writer (a, msgs)) = Writer (f a, msgs)
+instance Applicative ErrMsgM where
+ pure = return
+ (<*>) = ap
instance Monad ErrMsgM where
return a = Writer (a, [])
@@ -543,6 +548,9 @@ liftErrMsg = WriterGhc . return . runWriter
instance Functor ErrMsgGhc where
fmap f (WriterGhc x) = WriterGhc (fmap (first f) x)
+instance Applicative ErrMsgGhc where
+ pure = return
+ (<*>) = ap
instance Monad ErrMsgGhc where
return a = WriterGhc (return (a, []))