From: Javier Sagredo Date: Thu, 7 May 2026 01:12:24 +0000 (+0200) Subject: Add a third reason to the unresolved-faminst placeholder explanation X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=8a53ac2f7263ec5b3d49879347b669f63d4094d7;p=classgraph.git Add a third reason to the unresolved-faminst placeholder explanation The user observed cases where a more general fam-instance LHS (e.g. `data instance LedgerState (ShelleyBlock proto era) mk`) should cover a more concrete use site (`… EmptyMK`) but the chain doesn't draw — biUnify's wildcard rule on TyVarRef should handle this in principle, but kind-arg interactions in the rep TyCon can leave the unifier looking at structure that doesn't quite line up. List this as a third reason so the side panel stops implying the only failures are external-family / nested-args. Co-Authored-By: Claude Opus 4.7 (1M context) --- diff --git a/data/viewer.html b/data/viewer.html index d1e90d6..9b3e7fc 100644 --- a/data/viewer.html +++ b/data/viewer.html @@ -46,7 +46,7 @@
Superclass constraint, satisfied by an instance in this project
Superclass constraint, points at a predicate node (external or context)
Family → one of its type family instances
-
Type family instance resolves to a class instance (chain)
+
Type family instance is an instance of class

Controls

Click → highlight + side panel
diff --git a/data/viewer.js b/data/viewer.js index 8355b8a..5e74342 100644 --- a/data/viewer.js +++ b/data/viewer.js @@ -1976,6 +1976,7 @@
  1. External family — the family's equations live in a package you haven't extracted. Re-run the plugin against the defining package to surface them here.
  2. Nested or abstract args — classgraph doesn't fully simulate GHC's type-family rewrite chain. For example, F (G a) won't match a concrete instance like F (Bar c) unless we can first reduce G a to a Bar _ shape; if a stays abstract or the inner reduction fails, the outer family looks unresolvable even though the equations are in your dumps.
  3. +
  4. More general instance available — a fam-instance whose LHS is strictly more general than your use site (e.g. you have data instance LedgerState (ShelleyBlock proto era) mk but the use site is LedgerState (ShelleyBlock proto era) EmptyMK) may not be picked up by our unifier when the abstract slot's kind interacts with how GHC stores the rep. The general instance is the right one to read here even though it isn't drawn as a chain edge.

Open the family node (the diamond above this row) to see all the fam-instances we do have for it — one of them may be the satisfier in the actual program.