-
Notifications
You must be signed in to change notification settings - Fork 208
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User defined aggregate #2282
User defined aggregate #2282
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## master #2282 +/- ##
==========================================
+ Coverage 77.39% 77.43% +0.03%
==========================================
Files 461 468 +7
Lines 29004 29162 +158
==========================================
+ Hits 22448 22581 +133
- Misses 6556 6581 +25
|
@julienhenry - there is a clash with your changes. Could you fix it? |
@b-scholz I have updated to latest master branch. We still need to verify in the TypeChecker that the user-defined functor used in the aggregate is used correctly, there is no such check at the moment. |
Thanks for the contribution! Please, can you update the documentation as well? |
Aggregates in Soufflé are very useful. However, there are use-cases where a developer would want to use its own aggregating function (instead of the intrinsics min, max, count, sum, etc.)
In this PR, I propose a way to use a user defined functor, declared as usual with a
.functor ...
, as the function to apply on an aggregate.A example use of user-defined aggregate would be :
The above example:
res
to[0,0]
.res = @lub(res, i)
for eachi
satisfyingI(x,i)
.We can discuss on the syntax if the above one is not convenient...
Current limitations: