The current behavior is that if an action is a function it by default gets called; I have some scenarios where this is undesireable. For instance, I might want to decide how to process data based on an enum and bind my processing function to that enum. I would want to know which function to use, but not yet call it and certainly not with the enum value. Or alternatively I might want to interpret and pattern match on dataset A and based on that determine how to process an entirely different dataset B.
Example:
Sounds like the better option here is to make a new version of match that suits your needs.
Take every second parameter and wrap it in a lambda and then pass that to match.
The current behavior is that if an action is a function it by default gets called; I have some scenarios where this is undesireable. For instance, I might want to decide how to process data based on an enum and bind my processing function to that enum. I would want to know which function to use, but not yet call it and certainly not with the enum value. Or alternatively I might want to interpret and pattern match on dataset A and based on that determine how to process an entirely different dataset B. Example:
The above would fail because it would call the function with a
dict
while the functions expects astring
.currently the above is possible with the following hack:
however, this drastically diminishes readability.
I propose one of the following 2 solutions:
match
that determines whether the given action is called or not.