summaryrefslogtreecommitdiff
path: root/libraries/base/Text
diff options
context:
space:
mode:
authorAdam Gundry <adam@well-typed.com>2015-10-16 13:58:52 +0100
committerAdam Gundry <adam@well-typed.com>2015-10-16 13:58:52 +0100
commit5a1b4f814f74ec1c48152d97523744518e212777 (patch)
tree7c2207ecacbd37f12c78dbcf9d4334827164e0fb /libraries/base/Text
parent6757950cdd8bb0af0355539987ee78401a6a8f6b (diff)
parent808bbdf08058785ae5bc59b5b4f2b04951d4cbbf (diff)
downloadhaskell-wip/orf-reboot.tar.gz
Merge remote-tracking branch 'origin/master' into wip/orf-rebootwip/orf-reboot
Conflicts: compiler/rename/RnNames.hs compiler/typecheck/TcRnMonad.hs utils/haddock
Diffstat (limited to 'libraries/base/Text')
-rw-r--r--libraries/base/Text/ParserCombinators/ReadP.hs7
-rw-r--r--libraries/base/Text/ParserCombinators/ReadPrec.hs3
2 files changed, 3 insertions, 7 deletions
diff --git a/libraries/base/Text/ParserCombinators/ReadP.hs b/libraries/base/Text/ParserCombinators/ReadP.hs
index 034411d6bf..bae2abc90e 100644
--- a/libraries/base/Text/ParserCombinators/ReadP.hs
+++ b/libraries/base/Text/ParserCombinators/ReadP.hs
@@ -103,7 +103,7 @@ data P a
-- Monad, MonadPlus
instance Applicative P where
- pure = return
+ pure x = Result x Fail
(<*>) = ap
instance MonadPlus P where
@@ -111,8 +111,6 @@ instance MonadPlus P where
mplus = (<|>)
instance Monad P where
- return x = Result x Fail
-
(Get f) >>= k = Get (\c -> f c >>= k)
(Look f) >>= k = Look (\s -> f s >>= k)
Fail >>= _ = Fail
@@ -161,11 +159,10 @@ instance Functor ReadP where
fmap h (R f) = R (\k -> f (k . h))
instance Applicative ReadP where
- pure = return
+ pure x = R (\k -> k x)
(<*>) = ap
instance Monad ReadP where
- return x = R (\k -> k x)
fail _ = R (\_ -> Fail)
R m >>= f = R (\k -> m (\a -> let R m' = f a in m' k))
diff --git a/libraries/base/Text/ParserCombinators/ReadPrec.hs b/libraries/base/Text/ParserCombinators/ReadPrec.hs
index 027648d9e8..02268364ca 100644
--- a/libraries/base/Text/ParserCombinators/ReadPrec.hs
+++ b/libraries/base/Text/ParserCombinators/ReadPrec.hs
@@ -75,11 +75,10 @@ instance Functor ReadPrec where
fmap h (P f) = P (\n -> fmap h (f n))
instance Applicative ReadPrec where
- pure = return
+ pure x = P (\_ -> pure x)
(<*>) = ap
instance Monad ReadPrec where
- return x = P (\_ -> return x)
fail s = P (\_ -> fail s)
P f >>= k = P (\n -> do a <- f n; let P f' = k a in f' n)