For :- to work nicely the Failure side of the Result needs to line up with the return value.
While this can be simplified by always using the same type,
this is an unresonalb requirement.
This lets custsomers align the Failure side of return value.
AlignFailure may also be a good name.
Example
function Foo(): Result<string, int>
function Bar(): Result<string, string> {
var fooString :- Foo().MapFailure(_ => "Foo failed.");
// work
Success(fooString)
}
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.
For
:-
to work nicely the Failure side of theResult
needs to line up with the return value. While this can be simplified by always using the same type, this is an unresonalb requirement.This lets custsomers align the
Failure
side of return value. AlignFailure may also be a good name.Example
By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.