]> Repositorios git - classgraph.git/commit
Render instance-context equalities as arrows too
authorJavier Sagredo <[email protected]>
Fri, 19 Jun 2026 16:03:56 +0000 (18:03 +0200)
committerJavier Sagredo <[email protected]>
Fri, 19 Jun 2026 16:03:56 +0000 (18:03 +0200)
commit9f81486fb3ce31d5f0b97e1db8b1e7cde96334d5
treee2cb1e56c605361a7e8b4f50036722583bdd841f
parentb7858140e2806d7ce3f0c6e928bb4f55af6ae53b
Render instance-context equalities as arrows too

Follow-up to the equality-superclass change: instance-context equality
constraints (`instance (a ~ b) => ...`) were drawn as `where a ~ b` chips
baked into the instance node's label. Now they render the same way as
equality superclasses — an edge to a shared `(~)` node labelled
`-{a}-{b}->` — so the two views are consistent.

- ensureEqNode: the shared `(~)` (or `(~~)`) node, modelled as an external
  class node, deduped by the operator's qid so all equalities converge.
- parenthesiseOp: JS mirror of Render.hs's externalLabel (`~` -> `(~)`).
- addInstanceContext draws an `#eq#` edge per equality predicate and still
  surfaces any type families inside it (e.g. `Norm` in `Norm a ~ Int`).
- The instance node label drops the `where` chips; the `eqs` strings stay
  on the node data for the side panel.

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