FsToolkit.ErrorHandling
FsToolkit.ErrorHandling copied to clipboard
Add Option.maybe
Is your feature request related to a problem? Please describe.
Result module contains
either : ('a -> 'c) -> ('b -> 'c) -> Result<'a, 'b> -> 'c
Having its counterpart Option.maybe would be great:
maybe : (() -> 'b) -> ('a -> 'b) -> Option<'a> -> 'b
Describe alternatives you've considered
An obvious alternative is to use Option.fold or Option.map f >> Option.defaultWith g but it is the same level of inconvenience that Result.either solves for Result.fold.