diff options
author | Herbert Valerio Riedel <hvr@gnu.org> | 2016-03-08 17:26:00 +0100 |
---|---|---|
committer | Herbert Valerio Riedel <hvr@gnu.org> | 2016-03-08 17:26:26 +0100 |
commit | 1c76e1686bd4291556ae9357151f256c805b4b5d (patch) | |
tree | 2ebf12bf489a715b8b1cbb61d5d44beda1273483 /testsuite/tests/stranal | |
parent | 941b8f5fa1ffbf404fde1f59a7866b937efd173a (diff) | |
download | haskell-1c76e1686bd4291556ae9357151f256c805b4b5d.tar.gz |
template-haskell: define `MonadFail Q` instance
When `MonadFail`is available, this patch makes `MonadFail` a superclass
of `Quasi`, and `Q` an instance of `MonadFail`.
NB: Since f16ddcee0c64a92ab911a7841a8cf64e3ac671fd, we need to be able
to compile `template-haskell` with stage0 compilers that don't provide
a `MonadFail` class yet. Once we reach GHC 8.3 development we can drop
the CPP conditionals again.
Addresses #11661
Reviewed By: bgamari, goldfire
Differential Revision: https://phabricator.haskell.org/D1982
Diffstat (limited to 'testsuite/tests/stranal')
-rw-r--r-- | testsuite/tests/stranal/should_compile/T9208.hs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/testsuite/tests/stranal/should_compile/T9208.hs b/testsuite/tests/stranal/should_compile/T9208.hs index f587da7640..bf98fba9f6 100644 --- a/testsuite/tests/stranal/should_compile/T9208.hs +++ b/testsuite/tests/stranal/should_compile/T9208.hs @@ -22,6 +22,9 @@ module Eval ( import Control.Applicative import Control.Monad +#if __GLASGOW_HASKELL__ >= 800 +import Control.Monad.Fail (MonadFail(fail)) +#endif import Data.Binary import Data.Binary.Get @@ -73,6 +76,11 @@ instance Monad GHCJSQ where return (a, s'') return = pure +#if __GLASGOW_HASKELL__ >= 800 +instance MonadFail GHCJSQ where + fail = undefined +#endif + instance TH.Quasi GHCJSQ where qRunIO m = GHCJSQ $ \s -> fmap (,s) m -- | the Template Haskell server |