There is no easy way to do so, but you could do it via reflection. Using the isUnionCase
function from this answer, we can write:
let success = isUnionCase <@ Success @>
For this particular case, I think the success
function is succinct enough to be qualified as one-liner:
let success = function Success _ -> true | _ -> false
As @Daniel said, compiler-generated Is*
functions should be exposed. There is a related suggestion on User Voice, perhaps you should vote so that it is implemented in F# 4.0.