]> Repositorios git - classgraph.git/commitdiff
Drop the data-fam-instance "Kind" panel entry entirely
authorJavier Sagredo <[email protected]>
Thu, 7 May 2026 00:24:36 +0000 (02:24 +0200)
committerJavier Sagredo <[email protected]>
Thu, 7 May 2026 00:24:36 +0000 (02:24 +0200)
The previous text was wrong on two counts: it labelled the row "Kind"
even though it wasn't showing any kind, and it called the rhs a
"synthetic GHC-internal data constructor" — but the user *did* write
the data constructor (`CrateInt Int`, etc.); the only synthetic part
is the R: TyCon GHC uses internally to represent the instance.

We don't extract data constructors into the schema, so we have
nothing useful to show on the rhs side for data fam-instances. Just
omit the row.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
data/viewer.js

index efbe9518dcb571ba0383643d1a62c288f59a406d..c58b11041f0aab95a8f911bac969507bfb03655e 100644 (file)
       `<dd><ul>${fi.fiTyVars.map(v =>
         `<li>${escape(v.tvName)}<span style="color:#888"> :: ${escape(v.tvKind)}</span></li>`).join('')}</ul></dd>`;
     const src = renderDefinedAt(fi.fiSrc, fi.fiDefinedIn || fi.fiFamily.qnPackage);
-    // For data fam-instances we *don't* show a "Right-hand side" row.
-    // GHC's representation is the synthetic R: TyCon (`R:CrateInt`),
-    // and after our R: rewrite it's the abstract @FamilyApp Family
-    // [args]@ form — structurally equal to the LHS, so labelling it
-    // "Right-hand side" was actively misleading. Show a brief
-    // explanatory note instead.
+    // Data fam-instances: omit the "Right-hand side" row entirely.
+    // What GHC stores as the rhs is the synthetic R: TyCon, and our
+    // R: rewrite turns it into a copy of the LHS — neither is the
+    // user's actual data-constructor declaration. We don't extract
+    // the data constructors themselves into the schema, so we have
+    // nothing useful to show.
     const rhsEntry = fi.fiIsData
-      ? `<dt>Kind</dt><dd><em>Data instance — the right-hand side is a synthetic GHC-internal data constructor and isn't shown.</em></dd>`
+      ? ''
       : `<dt>Right-hand side</dt><dd>${escape(renderArg(fi.fiRhs, fi.fiTyVars))}</dd>`;
     return `
       <h2>${head}</h2>