-
Notifications
You must be signed in to change notification settings - Fork 80
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
Custom filters #70
Custom filters #70
Conversation
Wow, thanks for your really fast effort! I'll have a closer look later, but from a first glance, this looks quite good. Well done. |
I plan to make a few changes to your implementation, in particular replacing the |
Awesome, thanks for the quick merge! I look forward to the next release :) |
One thing I notice using this is that the |
Do you mean the type in |
Yeah, that one. Also it should be fine to add |
Introduces the
CustomFilter
type and a new methodDefinitions.insert_custom(name, filter)
. Custom filters can be constructed from an arity, a run function, and an optional update function. If no update function is provided, the filter cannot be used likefilter |= ...
.No particular care is taken to make writing filters ergonomic, but it's fairly straightforward nonetheless. For example, here's a basic sqrt:
Also:
Definitions
so it's easier to use in tests to call multiple times.NonUpdatable
for custom filters that can't be used in update position, andCustom
, for use by custom filters.Fixes #69