Repository : ssh://[email protected]/haddock On branch : master Link : http://git.haskell.org/?p=haddock.git;a=commit;h=e72cc68ad7be37948621ec3006f29d9d2e0cc365
>--------------------------------------------------------------- commit e72cc68ad7be37948621ec3006f29d9d2e0cc365 Author: David Luposchainsky <[email protected]> Date: Fri Sep 6 19:47:22 2013 +0200 Fix AMP warnings Signed-off-by: Austin Seipp <[email protected]> >--------------------------------------------------------------- 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, [])) _______________________________________________ ghc-commits mailing list [email protected] http://www.haskell.org/mailman/listinfo/ghc-commits
