I have a discriminated union type:
type F =
| A of int
| B of float
Suppose I have a list of F that has been filtered to yield only objects of type A:
let listOfAs=list.filter (fun f -> match f with | A(f') -> true | _ -> false)
How can I work with the resulting list of F without requiring pattern matches everywhere in my code? The compiler doesn't like a direct cast, eg
list.map (fun f -> int f) listOfAs