[commit: ghc] master: template-haskell: set explicit return=pure (d6d421c)
git at git.haskell.org
git at git.haskell.org
Sun Oct 18 09:51:39 UTC 2015
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/d6d421c193aa2ba171ee7d70efd875c9dba1756c/ghc
>---------------------------------------------------------------
commit d6d421c193aa2ba171ee7d70efd875c9dba1756c
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Sun Oct 18 11:53:23 2015 +0200
template-haskell: set explicit return=pure
This fixups a thinko in c6781a5064049e0a7c17c1f2239567a3c44955af
>---------------------------------------------------------------
d6d421c193aa2ba171ee7d70efd875c9dba1756c
libraries/template-haskell/Language/Haskell/TH/PprLib.hs | 1 +
libraries/template-haskell/Language/Haskell/TH/Syntax.hs | 1 +
2 files changed, 2 insertions(+)
diff --git a/libraries/template-haskell/Language/Haskell/TH/PprLib.hs b/libraries/template-haskell/Language/Haskell/TH/PprLib.hs
index e398094..1a99207 100644
--- a/libraries/template-haskell/Language/Haskell/TH/PprLib.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/PprLib.hs
@@ -158,6 +158,7 @@ instance Applicative PprM where
(<*>) = ap
instance Monad PprM where
+ return = pure
m >>= k = PprM $ \s -> let (x, s') = runPprM m s
in runPprM (k x) s'
diff --git a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
index 607e6da..4d30a9d 100644
--- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
+++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs
@@ -161,6 +161,7 @@ runQ (Q m) = m
instance Monad Q where
Q m >>= k = Q (m >>= \x -> unQ (k x))
(>>) = (*>)
+ return = pure
fail s = report True s >> Q (fail "Q monad failure")
instance Functor Q where
More information about the ghc-commits
mailing list