Say, I have something like this. It does not compile, but you can see what I'm trying to do. I've tried to google every which way, but no dice. Can this be done?
let inline read (s:string) : ^x =
let parsed = (^x : (static member ofString: string -> ^x option) (s))
// this is the bit I'm not sure how do to. This doesn't compile.
// I'm trying to determine what the statically chosen type for ^x is.
let t = typeof<^x>
match parsed with
| Some y -> y
| None -> failwithf "can't parse %s into %s" s (t.Name)