diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2019-03-19 17:47:55 -0400 |
---|---|---|
committer | Ben Gamari <ben@well-typed.com> | 2019-07-09 11:52:45 -0400 |
commit | 6a03d77b9a9915e4b37fe1ea6688c135e7b00654 (patch) | |
tree | 4154abaa768adbfadc4eb17db620c3ed08b82c5f /ghc | |
parent | 5af815f2e43e9f1b5ca9ec0803f9fccabb49e2fe (diff) | |
download | haskell-6a03d77b9a9915e4b37fe1ea6688c135e7b00654.tar.gz |
Use an empty data type in TTG extension constructors (#15247)
To avoid having to `panic` any time a TTG extension constructor is
consumed, this MR introduces an uninhabited 'NoExtCon' type and uses
that in every extension constructor's type family instance where it
is appropriate. This also introduces a 'noExtCon' function which
eliminates a 'NoExtCon', much like 'Data.Void.absurd' eliminates
a 'Void'.
I also renamed the existing `NoExt` type to `NoExtField` to better
distinguish it from `NoExtCon`. Unsurprisingly, there is a lot of
code churn resulting from this.
Bumps the Haddock submodule. Fixes #15247.
Diffstat (limited to 'ghc')
-rw-r--r-- | ghc/GHCi/UI.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ghc/GHCi/UI.hs b/ghc/GHCi/UI.hs index 31c6db055d..f5cae41578 100644 --- a/ghc/GHCi/UI.hs +++ b/ghc/GHCi/UI.hs @@ -1252,7 +1252,7 @@ runStmt input step = do mk_stmt :: SrcSpan -> HsBind GhcPs -> GhciLStmt GhcPs mk_stmt loc bind = let l = L loc - in l (LetStmt noExt (l (HsValBinds noExt (ValBinds noExt (unitBag (l bind)) [])))) + in l (LetStmt noExtField (l (HsValBinds noExtField (ValBinds noExtField (unitBag (l bind)) [])))) -- | Clean up the GHCi environment after a statement has run afterRunStmt :: GhciMonad m @@ -1662,7 +1662,7 @@ defineMacro overwrite s = do body = nlHsVar compose_RDR `mkHsApp` (nlHsPar step) `mkHsApp` (nlHsPar expr) tySig = mkLHsSigWcType (stringTy `nlHsFunTy` ioM) - new_expr = L (getLoc expr) $ ExprWithTySig noExt body tySig + new_expr = L (getLoc expr) $ ExprWithTySig noExtField body tySig hv <- GHC.compileParsedExprRemote new_expr let newCmd = Command { cmdName = macro_name @@ -1730,7 +1730,7 @@ getGhciStepIO = do ioM = nlHsTyVar (getRdrName ioTyConName) `nlHsAppTy` stringTy body = nlHsVar (getRdrName ghciStepIoMName) tySig = mkLHsSigWcType (ghciM `nlHsFunTy` ioM) - return $ noLoc $ ExprWithTySig noExt body tySig + return $ noLoc $ ExprWithTySig noExtField body tySig ----------------------------------------------------------------------------- -- :check |