mangle icon indicating copy to clipboard operation
mangle copied to clipboard

suggested syntax for aggregation

Open burakemir opened this issue 5 months ago • 0 comments

The aggregation syntax - apart from being quite undocumented - needs much explanation. Erik Meijer suggested via LinkedIn:

| I would love to be able to write something like

count_projects_with_vulnerable_log4j(Num) :-
 projects_with_vulnerable_log4j(P)
 |> { AllVulnProjects =>
 val groups = AllVulnProjects.groupBy { it.projectId }
 val Num = groups.values.sumOf { it.size }
 }

The reason for "do transformations" |> do fn:group_by(...) was to have something declarative so that it could be implemented and optimized differently. However, with a judiciously designed sublanguage, that may still be possible.

burakemir avatar Aug 28 '25 07:08 burakemir