Add `Action` based `Match` (or similarly named) method
See original GitHub issueI am attempting to replace my custom T4 based union generator with dunet. Currently, my implementation generates an Either
method which is functionally identical to the Match
method generated by dunet, and a Do
method, which is similar, but takes an Action
for each union case, and does not return a value. Dunet does not appear to currently have such a method. The generated code should be identical to the current Match
, except that it would return void
rather than TMatchOutput
, would take Action
instead of Func
delegates, and would not need to be generic on TMatchOutput
, as there would be no output.
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
How to name a method which may or may not perform an ...
The reason I am not using two separate methods ( shouldPerformAction() and performAction() ) is because both the condition and the action depend ......
Read more >Creating agent skills to use for routing
A name; A way to add that skill to tickets; A set of agents who have that skill. Understanding how skills are used...
Read more >Defining ASP.NET Core Controller action constraint to ...
The name of the method is different but they both will receive a single argument of type string. When the routing engine can't...
Read more >Matching methods and techniques for rule packages
The matching can be performed using either an exact match or word match based algorithms. Exact match uses a case-sensitive algorithm that ...
Read more >Matching methods for causal inference: A review and ...
Another effective strategy is to include a small set of covariates known to be related to the outcomes of interest, do the matching,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Looking at the generated code, it appears that it would work well enough. I noticed that a corresponding task version is not created. Although this is not a feature I am seeking currently, I believe it would make sense to implement for the sake of symmetry.
I’ve done similar in the past. For now, the way I decided to work around it is that I instead returned a different
Action
delegate for each match case, then invoked the action returned.Anonymized example: