const fiNodeId = 'faminst:' + fi._idx;
seenNodes.add(fiNodeId);
const args = renderArgsCompact(fi.fiArgs, fi.fiTyVars);
- const label = fi.fiIsData
- ? (args || '<no args>')
- : args + ' = ' + renderArg(fi.fiRhs, fi.fiTyVars);
+ const lhs = args || '<no args>';
+ let label;
+ if (fi.fiIsData) {
+ // In the family view the family name is already shown at the
+ // top of the graph, so each row only needs `args = Cons`. We
+ // *do* want the constructor names here, the same way the
+ // instance view's renderFamInstHead does — just don't repeat
+ // the family name.
+ const dcs = fi.fiDataCons || [];
+ const cons = dcs.map(dc => dc.dcName || '?').join(' | ');
+ label = cons ? lhs + ' = ' + cons : lhs;
+ } else {
+ label = lhs + ' = ' + renderArg(fi.fiRhs, fi.fiTyVars);
+ }
els.push({ group: 'nodes', data: {
id: fiNodeId,
label,