summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbertValerioRiedel <>2019-04-14 21:55:00 (GMT)
committerhdiff <hdiff@hdiff.luite.com>2019-04-14 21:55:00 (GMT)
commit2c159cb49186f57e5529f9f2a38cb885a647e4fe (patch)
tree0941b19808c59b7066bd6460c2a7b0c6270c02e6
parente0eca51e000f6ab107239d30aec168124f023ec9 (diff)
version 8.6.48.6.4
-rw-r--r--GHCi/Message.hs17
-rw-r--r--GHCi/TH.hs13
-rw-r--r--ghci.cabal8
3 files changed, 21 insertions, 17 deletions
diff --git a/GHCi/Message.hs b/GHCi/Message.hs
index 3f0bad9..7ae1614 100644
--- a/GHCi/Message.hs
+++ b/GHCi/Message.hs
@@ -245,6 +245,7 @@ data THMessage a where
StartRecover :: THMessage ()
EndRecover :: Bool -> THMessage ()
+ FailIfErrs :: THMessage (THResult ())
-- | Indicates that this RunTH is finished, and the next message
-- will be the result of RunTH (a QResult).
@@ -275,9 +276,10 @@ getTHMessage = do
14 -> THMsg <$> return ExtsEnabled
15 -> THMsg <$> return StartRecover
16 -> THMsg <$> EndRecover <$> get
- 17 -> return (THMsg RunTHDone)
- 18 -> THMsg <$> AddModFinalizer <$> get
- 19 -> THMsg <$> (AddForeignFilePath <$> get <*> get)
+ 17 -> THMsg <$> return FailIfErrs
+ 18 -> return (THMsg RunTHDone)
+ 19 -> THMsg <$> AddModFinalizer <$> get
+ 20 -> THMsg <$> (AddForeignFilePath <$> get <*> get)
_ -> THMsg <$> AddCorePlugin <$> get
putTHMessage :: THMessage a -> Put
@@ -299,10 +301,11 @@ putTHMessage m = case m of
ExtsEnabled -> putWord8 14
StartRecover -> putWord8 15
EndRecover a -> putWord8 16 >> put a
- RunTHDone -> putWord8 17
- AddModFinalizer a -> putWord8 18 >> put a
- AddForeignFilePath lang a -> putWord8 19 >> put lang >> put a
- AddCorePlugin a -> putWord8 20 >> put a
+ FailIfErrs -> putWord8 17
+ RunTHDone -> putWord8 18
+ AddModFinalizer a -> putWord8 19 >> put a
+ AddForeignFilePath lang a -> putWord8 20 >> put lang >> put a
+ AddCorePlugin a -> putWord8 21 >> put a
data EvalOpts = EvalOpts
diff --git a/GHCi/TH.hs b/GHCi/TH.hs
index aebc32c..858e556 100644
--- a/GHCi/TH.hs
+++ b/GHCi/TH.hs
@@ -105,6 +105,7 @@ import qualified Data.ByteString as B
import qualified Data.ByteString.Lazy as LB
import Data.Data
import Data.Dynamic
+import Data.Either
import Data.IORef
import Data.Map (Map)
import qualified Data.Map as M
@@ -169,13 +170,13 @@ instance TH.Quasi GHCiQ where
qReport isError msg = ghcCmd (Report isError msg)
-- See Note [TH recover with -fexternal-interpreter] in TcSplice
- qRecover (GHCiQ h) (GHCiQ a) = GHCiQ $ \s -> (do
+ qRecover (GHCiQ h) a = GHCiQ $ \s -> mask $ \unmask -> do
remoteTHCall (qsPipe s) StartRecover
- (r, s') <- a s
- remoteTHCall (qsPipe s) (EndRecover False)
- return (r,s'))
- `catch`
- \GHCiQException{} -> remoteTHCall (qsPipe s) (EndRecover True) >> h s
+ e <- try $ unmask $ runGHCiQ (a <* ghcCmd FailIfErrs) s
+ remoteTHCall (qsPipe s) (EndRecover (isLeft e))
+ case e of
+ Left GHCiQException{} -> h s
+ Right r -> return r
qLookupName isType occ = ghcCmd (LookupName isType occ)
qReify name = ghcCmd (Reify name)
qReifyFixity name = ghcCmd (ReifyFixity name)
diff --git a/ghci.cabal b/ghci.cabal
index b8b4ea6..4e1fb1a 100644
--- a/ghci.cabal
+++ b/ghci.cabal
@@ -1,5 +1,5 @@
name: ghci
-version: 8.6.1
+version: 8.6.4
license: BSD3
license-file: LICENSE
category: GHC
@@ -72,9 +72,9 @@ library
containers >= 0.5 && < 0.7,
deepseq == 1.4.*,
filepath == 1.4.*,
- ghc-boot == 8.6.1,
- ghc-boot-th == 8.6.1,
- ghc-heap == 8.6.1,
+ ghc-boot == 8.6.4,
+ ghc-boot-th == 8.6.4,
+ ghc-heap == 8.6.4,
template-haskell == 2.14.*,
transformers == 0.5.*