-
Notifications
You must be signed in to change notification settings - Fork 73
Closed
Description
Preamble:
I have used Argu for many years but PostProcessResult always scared me (and I had not seen it organically).
The naming put me off - it sounds like something some metaprogrammer genius would be doing in some esoteric scenario.
In recent times, I actually saw/looked at the tutorial for the first time, and realised it was actually quite useful (I used to do Option.map and think no more of it, but having exceptions be trapped and reported wrt that specific argument is very desirable)
The other issue is that short names matter
Now that there is a GetResult with a fun () -> <default>, it would seem some additional overloads would be useful:
GetResult<T>(Thing, fun x -> <map x to T>) : 'T(akaPostProcessResult)TryGetResult<T>(Thing, fun x -> <map x to T>) : 'T option(akaTryPostProcessResult)GetResult<T, U>(Thing, (fun () -> <default Thing : T>), fun x -> <map x to U>) : 'UGetResult<T, U>(Thing, <default Thing: T>, fun x -> <map x to U>) : 'U(if I can only have one, I'd take the preceding one, but its way less parens)
The main questions for me are:
- does anyone other than me see the point of these extensions? I have real code that would benefit from these a lot...
- is the current name actually better anyway
- is Argu just too old.mature to change something fundamental like this?
- would the overloading cause mess/conflict in real code
I propose to:
- add the overloads now, possibly as a
-rcso it can be road-tested - In V7, Obsolete PostProcessResult/TryPostProcessResult (with recommendation to use GetResult/TryGetResult instead)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels