If I have a discriminated union
type Result<'T,'U> =
| Success of 'T
| Failure of 'U
Then I can create a pattern matching function to test for success
let success = function
| Success(_) -> true
| _ -> false
Can I create this as a one liner, something like this?
let success = fun x -> x = Success(_)
This last line doesn't compile, but I think it demonstrates my intent