diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2015-12-31 16:42:38 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2015-12-31 22:38:52 +0100 |
commit | 3c8cb7f43c89e9a2b754adc5e639985f0b95b1f1 (patch) | |
tree | 7c027a215ed2b15fd66ce99ca533cc9348df745e /libraries | |
parent | 2f923ce2ab8bad6d01645c735c81bbf1b9ff1e05 (diff) | |
download | haskell-3c8cb7f43c89e9a2b754adc5e639985f0b95b1f1.tar.gz |
Remove some redundant definitions/constraints
Starting with GHC 7.10 and base-4.8, `Monad` implies `Applicative`,
which allows to simplify some definitions to exploit the superclass
relationship. This a first refactoring to that end.
Diffstat (limited to 'libraries')
-rw-r--r-- | libraries/ghci/GHCi/TH.hs | 1 | ||||
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH/PprLib.hs | 1 | ||||
-rw-r--r-- | libraries/template-haskell/Language/Haskell/TH/Syntax.hs | 3 |
3 files changed, 1 insertions, 4 deletions
diff --git a/libraries/ghci/GHCi/TH.hs b/libraries/ghci/GHCi/TH.hs index f379dbc546..717192e39d 100644 --- a/libraries/ghci/GHCi/TH.hs +++ b/libraries/ghci/GHCi/TH.hs @@ -72,7 +72,6 @@ instance Monad GHCiQ where do (m', s') <- runGHCiQ m s (a, s'') <- runGHCiQ (f m') s' return (a, s'') - return = pure fail err = GHCiQ $ \s -> throwIO (GHCiQException s err) getState :: GHCiQ QState diff --git a/libraries/template-haskell/Language/Haskell/TH/PprLib.hs b/libraries/template-haskell/Language/Haskell/TH/PprLib.hs index 594d7dc54d..378888d77f 100644 --- a/libraries/template-haskell/Language/Haskell/TH/PprLib.hs +++ b/libraries/template-haskell/Language/Haskell/TH/PprLib.hs @@ -155,7 +155,6 @@ 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 becbbd6d7a..269bb70753 100644 --- a/libraries/template-haskell/Language/Haskell/TH/Syntax.hs +++ b/libraries/template-haskell/Language/Haskell/TH/Syntax.hs @@ -52,7 +52,7 @@ import Numeric.Natural -- ----------------------------------------------------- -class (Applicative m, Monad m) => Quasi m where +class Monad m => Quasi m where qNewName :: String -> m Name -- ^ Fresh names @@ -170,7 +170,6 @@ 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 |