[commit: haddock] master: Fix AMP warnings (e72cc68)

git at git.haskell.org git at git.haskell.org
Sun Sep 8 15:50:26 CEST 2013


Repository : ssh://git@git.haskell.org/haddock

On branch  : master
Link       : http://git.haskell.org/?p=haddock.git;a=commit;h=e72cc68ad7be37948621ec3006f29d9d2e0cc365

>---------------------------------------------------------------

commit e72cc68ad7be37948621ec3006f29d9d2e0cc365
Author: David Luposchainsky <dluposchainsky at gmail.com>
Date:   Fri Sep 6 19:47:22 2013 +0200

    Fix AMP warnings
    
    Signed-off-by: Austin Seipp <aseipp at pobox.com>


>---------------------------------------------------------------

e72cc68ad7be37948621ec3006f29d9d2e0cc365
 src/Haddock/Types.hs |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/Haddock/Types.hs b/src/Haddock/Types.hs
index bd4f10f..19a6c90 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, []))





More information about the ghc-commits mailing list