diff --git a/effekt/shared/src/main/scala/effekt/core/PrettyPrinter.scala b/effekt/shared/src/main/scala/effekt/core/PrettyPrinter.scala index 928de274a..8f75f943e 100644 --- a/effekt/shared/src/main/scala/effekt/core/PrettyPrinter.scala +++ b/effekt/shared/src/main/scala/effekt/core/PrettyPrinter.scala @@ -108,13 +108,15 @@ object PrettyPrinter extends ParenPrettyPrinter { def argsToDoc(targs: List[core.ValueType], vargs: List[core.Pure], bargs: List[core.Block]): Doc = val targsDoc = if targs.isEmpty then emptyDoc else brackets(targs.map(toDoc)) //val cargsDoc = if cargs.isEmpty then emptyDoc else brackets(cargs.map(toDoc)) - val vargsDoc = if vargs.isEmpty && !bargs.isEmpty then emptyDoc else vargs.map(toDoc) - val bargsDoc = bargs.map(toDoc) - targsDoc <> parens(vargsDoc) <> braces(bargsDoc) + val vargsDoc = if vargs.isEmpty && !bargs.isEmpty then emptyDoc else parens(vargs.map(toDoc)) + val bargsDoc = if bargs.isEmpty then emptyDoc else braces(bargs.map(toDoc)) + targsDoc <> vargsDoc <> bargsDoc def paramsToDoc(tps: List[symbols.Symbol], vps: List[ValueParam], bps: List[BlockParam]): Doc = { - val tpsDoc = if (tps.isEmpty) emptyDoc else brackets(tps.map(toDoc)) - tpsDoc <> parens(hsep(vps map toDoc, comma)) <> hcat(bps map toDoc) + val tpsDoc = if tps.isEmpty then emptyDoc else brackets(tps.map(toDoc)) + val vpsDoc = if vps.isEmpty && !bps.isEmpty then emptyDoc else parens(vps.map(toDoc)) + val bpsDoc = if bps.isEmpty then emptyDoc else hcat(bps.map(toDoc)) // already are in braces! + tpsDoc <> vpsDoc <> bpsDoc } def toDoc(instance: Implementation): Doc = {