diff options
author | Ryan Scott <ryan.gl.scott@gmail.com> | 2021-04-23 19:48:03 -0400 |
---|---|---|
committer | Zubin Duggal <zubin.duggal@gmail.com> | 2021-06-08 01:07:10 +0530 |
commit | 7ea3b7eb37ac87917ab490c835e8405646891be3 (patch) | |
tree | b2720484d7da45cb97ee3efe6a0bcfec412be0d0 /docs | |
parent | 9e724f6e5bcb31abd270ea44fb01b1edb18f626f (diff) | |
download | haskell-wip/hsExprType.tar.gz |
Introduce `hsExprType :: HsExpr GhcTc -> Type` in the new modulewip/hsExprType
`GHC.Hs.Syn.Type`
The existing `hsPatType`, `hsLPatType` and `hsLitType` functions have also been
moved to this module
This is a less ambitious take on the same problem that !2182 and !3866
attempt to solve. Rather than have the `hsExprType` function attempt to
efficiently compute the `Type` of every subexpression in an `HsExpr`, this
simply computes the overall `Type` of a single `HsExpr`.
- Explicitly forbids the `SplicePat` `HsIPVar`, `HsBracket`, `HsRnBracketOut`
and `HsTcBracketOut` constructors during the typechecking phase by using
`Void` as the TTG extension field
- Also introduces `dataConCantHappen` as a domain specific alternative to `absurd`
to handle cases where the TTG extension points forbid a constructor.
- Turns HIE file generation into a pure function that doesn't need access to the
`DsM` monad to compute types, but uses `hsExprType` instead.
- Computes a few more types during HIE file generation
- Makes GHCi's `:set +c` command also use `hsExprType` instead of going through
the desugarer to compute types.
Updates haddock submodule
Co-authored-by: Zubin Duggal <zubin.duggal@gmail.com>
Diffstat (limited to 'docs')
-rw-r--r-- | docs/users_guide/9.4.1-notes.rst | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/docs/users_guide/9.4.1-notes.rst b/docs/users_guide/9.4.1-notes.rst index 73901ad8be..68417b0a6b 100644 --- a/docs/users_guide/9.4.1-notes.rst +++ b/docs/users_guide/9.4.1-notes.rst @@ -40,3 +40,11 @@ Version 9.4.1 - The ``GHC.Exts.RuntimeRep`` parameter to ``GHC.Exts.raise#`` is now inferred: :: raise# :: forall (a :: Type) {r :: RuntimeRep} (b :: TYPE r). a -> b + +``ghc`` library +~~~~~~~~~~~~~~~ + +- A new ``GHC.Hs.Syn.Type`` module has been introduced which defines functions + for computing the ``Type`` of an ``HsExpr GhcTc`` in a pure fashion. + The ``hsLitType`` and ``hsPatType`` functions that previously lived in + ``GHC.Tc.Utils.Zonk`` have been moved to this module. |