Commit de31c19c authored by quchen's avatar quchen Committed by thoughtpolice
Browse files

Fix AMP warnings

parent 239a6f30
......@@ -69,9 +69,9 @@ module Distribution.Compat.ReadP
)
where
import Control.Monad( MonadPlus(..), liftM2, ap )
import Control.Monad( MonadPlus(..), liftM, liftM2, ap )
import Data.Char (isSpace)
import Control.Applicative (Applicative(..))
import Control.Applicative (Applicative(..), Alternative(empty, (<|>)))
infixr 5 +++, <++
......@@ -89,7 +89,7 @@ data P s a
-- Monad, MonadPlus
instance Functor (P s) where
fmap f x = x >>= return . f
fmap = liftM
instance Applicative (P s) where
pure = return
......@@ -106,6 +106,10 @@ instance Monad (P s) where
fail _ = Fail
instance Alternative (P s) where
empty = mzero
(<|>) = mplus
instance MonadPlus (P s) where
mzero = Fail
......
......@@ -55,7 +55,7 @@ import Data.Either
( partitionEithers )
import qualified Data.Map as Map
import Control.Monad
import Control.Applicative (Applicative(..))
import Control.Applicative (Applicative(..), Alternative(..))
import qualified Distribution.Compat.ReadP as Parse
import Distribution.Compat.ReadP
( (+++), (<++) )
......@@ -745,6 +745,10 @@ data MatchError = MatchErrorExpected String String
deriving (Show, Eq)
instance Alternative Match where
empty = mzero
(<|>) = mplus
instance MonadPlus Match where
mzero = matchZero
mplus = matchPlus
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment