]> Repositorios git - classgraph.git/commit
Rewrite data-family R: TyCons to abstract family applications
authorJavier Sagredo <[email protected]>
Wed, 6 May 2026 23:19:42 +0000 (01:19 +0200)
committerJavier Sagredo <[email protected]>
Wed, 6 May 2026 23:51:06 +0000 (01:51 +0200)
commit4b7c1a912c1224213e61f4f9f689ac6d007881b0
tree4939f0876f2eb516561894c207a4b10c0838413f
parentb3821ee2c065c9343f59a100ad66224ac0248da0
Rewrite data-family R: TyCons to abstract family applications

GHC represents `data instance Foo Args = …` internally as a
synthetic TyCon `R:FooArgs`. When such a TyCon shows up inside a
constraint or instance head — `NoThunks (R:ConsensusConfigPraos c)`
— the user reads it as the abstract family application
`NoThunks (ConsensusConfig (Praos c))`. Until now we faithfully
reported the rep TyCon, which surfaced the synthetic name.

In typeArg, gate on tyConFamInst_maybe before the regular TyConApp
path: when the TyCon is a data-family instance representation,
emit `FamilyApp parent parentArgs` instead. The viewer's existing
chain logic then naturally connects the @data instance@ row to any
class instance that mentions the abstract family.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
src/Classgraph/Extract.hs