From: Javier Sagredo Date: Thu, 7 May 2026 00:51:19 +0000 (+0200) Subject: Render multi-arg superclass edge labels as {a} {b}, not (a, b) X-Git-Url: https://git.sagredo.dev/?a=commitdiff_plain;h=5d0342bafafdc63c9a4fc9e4340ecf767d949b61;p=classgraph.git Render multi-arg superclass edge labels as {a} {b}, not (a, b) The tuple-shaped label `(a, b)` looked like the Haskell tuple type `(a, b)`, but it's actually a positional list of args being passed to the superclass — not packed into a pair. Switch to space- separated brace-wrapped form `{a} {b}` so the positional shape reads at a glance. Single-arg labels stay bare since there's no ambiguity. Co-Authored-By: Claude Opus 4.7 (1M context) --- diff --git a/src/Classgraph/Render.hs b/src/Classgraph/Render.hs index 3bc52cc..67d283b 100644 --- a/src/Classgraph/Render.hs +++ b/src/Classgraph/Render.hs @@ -301,16 +301,21 @@ flavorTag DataFam = "data" -- | Render the multi-param positional mapping carried by a 'SuperclassEdge'. -- +-- Multi-arg labels use @{arg1} {arg2}@ rather than @(arg1, arg2)@ — +-- the tuple shape was confusingly close to Haskell's @(a, b)@ tuple +-- type, but the args are positional, not packed. +-- -- Examples: -- -- * Single-arg: subclass @C a@, superclass @D a@ ⇒ label @"a"@. --- * Multi-param identity: subclass @C a b@, super @D a b@ ⇒ @"(a, b)"@. +-- * Multi-param identity: subclass @C a b@, super @D a b@ ⇒ @"{a} {b}"@. -- * Multi-param projection: subclass @C a b@, super @D b@ ⇒ @"b"@. -- * Family-mediated: subclass @C a@, super @D (F a)@ ⇒ @"(F a)"@. edgeLabel :: [TyVarInfo] -> SuperclassEdge -> Text edgeLabel subTvs se = case seArgs se of [arg] -> renderTypeArgShort subTvs arg - args -> "(" <> T.intercalate ", " (map (renderTypeArgShort subTvs) args) <> ")" + args -> T.intercalate " " + (map (\a -> "{" <> renderTypeArgShort subTvs a <> "}") args) renderTypeArgShort :: [TyVarInfo] -> TypeArg -> Text renderTypeArgShort subTvs ta = case ta of