diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2015-10-18 11:53:23 +0200 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2015-10-18 11:53:23 +0200 |
commit | d6d421c193aa2ba171ee7d70efd875c9dba1756c (patch) | |
tree | fd2707e194cecbfd625cebad21a9369ea876054d /libraries/template-haskell | |
parent | 1e34f6219526f747e1c0c686e447f73f6f72ed8d (diff) | |
download | haskell-d6d421c193aa2ba171ee7d70efd875c9dba1756c.tar.gz |
template-haskell: set explicit return=pure
This fixups a thinko in c6781a5064049e0a7c17c1f2239567a3c44955af
Diffstat (limited to 'libraries/template-haskell')
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH/PprLib.hs | 1 | ||||
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/libraries/template-haskell/Language/Haskell/TH/PprLib.hs b/libraries/template-haskell/Language/Haskell/TH/PprLib.hs index e398094fef..1a99207807 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 607e6da92c..4d30a9df14 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 |