diff options
author | romes <rodrigo.m.mesquita@gmail.com> | 2022-03-12 01:08:00 +0000 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2022-03-18 05:10:58 -0400 |
commit | b056adc8062b4fe015450a21eb70e32dcf7023f5 (patch) | |
tree | a29805d0c2ea73000497eeea311e77ce961d0a3c /compiler/GHC/Unit/Module/ModGuts.hs | |
parent | 4a2567f5641a4807584c90015dfc40a791f241b4 (diff) | |
download | haskell-b056adc8062b4fe015450a21eb70e32dcf7023f5.tar.gz |
TTG: Make HsQuote GhcTc isomorphic to NoExtField
An untyped bracket `HsQuote p` can never be constructed with
`p ~ GhcTc`. This is because we don't typecheck `HsQuote` at all.
That's OK, because we also never use `HsQuote GhcTc`.
To enforce this at the type level we make `HsQuote GhcTc` isomorphic
to `NoExtField` and impossible to construct otherwise, by using TTG field
extensions to make all constructors, except for `XQuote` (which takes `NoExtField`),
unconstructable, with `DataConCantHappen`
This is explained more in detail in Note [The life cycle of a TH quotation]
Related discussion: https://gitlab.haskell.org/ghc/ghc/-/merge_requests/4782
Diffstat (limited to 'compiler/GHC/Unit/Module/ModGuts.hs')
0 files changed, 0 insertions, 0 deletions