561d459e
by Andrei Borzenkov at 2026-11-18T17:16:54+04:00
Refactor ConDeclGADT to allow nested foralls and contexts (27425)
This patch refactors GADT prefix constructor layout, allowing
interleaved `forall`s, contexts, and value arguments. The main change:
```diff
data ConDecl pass
= ConDeclGADT
{ ...
- , con_inner_bndrs :: [LHsGadtTelescope pass]
- , con_cxts :: [LHsContext pass]
, con_g_args :: HsConDeclGADTDetails pass
...
}
| ....
```
Telescopes and contexts were moved into `HsConDeclGADTDetails`
and are now represented by `HsGadtArg`:
```haskell
data HsConDeclGADTDetails pass
= PrefixConGADT !(XPrefixConGADT pass) [LHsGadtArg pass] -- new!
| RecConGADT !(XRecConGADT pass)
(Maybe (LHsContext pass)) -- new!
(XRec pass [LHsConDeclRecField pass])
```
The RecConGADT constructor now has a `Maybe LHsContext` field to
enforce the distinction between prefix constructors and record
constructors.
`HsGadtTelescope` was renamed to `HsGadtArg` because it can
now represent contexts and value arguments in addition to
previously supported parentheses and telescopes.
Compiler subsystems that assume the old signature ordering:
typechecking
template-haskell (both ways)
HIE generation
check-exact
several places in Haddock
no-changelog