<div class="legend-row"><span class="swatch swatch-edge-wrap"><span class="swatch-edge dotted purple"></span></span><span>Context constraint required by this instance</span></div>
<div class="legend-row"><span class="swatch swatch-edge-wrap"><span class="swatch-edge solid amber"></span></span><span>Instance needs a superclass instance (matched locally)</span></div>
<div class="legend-row"><span class="swatch swatch-edge-wrap"><span class="swatch-edge dashed gray"></span></span><span>Needs a superclass instance (no local match)</span></div>
- <div class="legend-row"><span class="swatch swatch-edge-wrap"><span class="swatch-edge dashed violet-light"></span></span><span>Instance references this type family</span></div>
<div class="legend-row"><span class="swatch swatch-edge-wrap"><span class="swatch-edge solid violet"></span></span><span>Family → one of its type family instances</span></div>
<div class="legend-row"><span class="swatch swatch-edge-wrap"><span class="swatch-edge dotted violet"></span></span><span>Instance's associated <code>type instance</code> RHS</span></div>
<div class="legend-row"><span class="swatch swatch-edge-wrap"><span class="swatch-edge dotted teal"></span></span><span>Type family instance resolves to a class instance (chain)</span></div>
// focused-instance → family → concrete fam-instance → Eq instance
// visible as one path instead of two unrelated arrows.
function addFamilyLinksFromArgs(args, originId, edgeTag, predClassQn) {
+ // The "via Bar" arrow that used to connect @originId@ → family
+ // was removed (its meaning wasn't obvious). The function's
+ // remaining job is to surface fam-instance nodes plus the
+ // resolution chain that ends at a matching class instance.
const fams = collectFamilyRefs(args);
for (const fa of fams) {
const famNodeId = ensureFamilyNode(fa);
- const linkId = originId + '#viafam#' + edgeTag + '#' + famNodeId;
- if (!seenNodes.has(linkId)) {
- seenNodes.add(linkId);
- els.push({ group: 'edges', data: {
- id: linkId,
- source: originId,
- target: famNodeId,
- kind: 'via-family',
- label: 'via ' + fa.qnName,
- }});
- }
// Surface only the type family instances whose LHS *can* describe
// the focused instance's family-app — anything else is unrelated
- // noise (e.g. `TxIn ByronBlock` while looking at a Shelley
- // instance). Run the relevance check *before* creating the
+ // noise. Run the relevance check *before* creating the
// fam-instance node so irrelevant rows are skipped entirely.
for (const fi of (famInstsByFamily.get(famNodeId) || [])) {
let resolvedArgs = null;
width: 1.4,
},
},
- // Instance view: via-family (instance -> family node, indicating the
- // constraint mentions a type family that must be defined elsewhere).
- {
- selector: 'edge[kind = "via-family"]',
- style: {
- 'line-color': '#c084fc',
- 'target-arrow-color': '#c084fc',
- 'line-style': 'dashed',
- width: 1.2,
- 'font-size': 9,
- },
- },
// Family/instance view: fam-defines (family -> fam-instance node)
{
selector: 'edge[kind = "fam-defines"]',