Right now, when I have a Result type, it seems like I need to do a match to find if it is ok, or not.
So, I am trying to simplify this to be able to use if, like that:
let a : Result<string, string> = ...
if a.IsOk then ....
Here is my attempt
[<AutoOpen>]
module ResultHelper =
type Result with
member this.IsOk =
match this with
| Ok _ -> true
| Error _ -> false
but this will not compile.
Using:
type Result<_, _> with
doesn't help either
How can I achieve this?