I have Some v where v could be an int, bool, or even something like string option * string, how can I check if v is an int, bool, or string option * string?
If this isn't possible then maybe I am approaching my problem wrong.
Depending on what v is, I want to return different types that are of the same polymorphic type, say, type 'value' that I declared.
value
look like? What constructors does it have? If its liketype 'a value = Val of 'a
, you can create e.g. a functionlet convert_option_to_value = function | Some x -> Val x | None -> failwith "not supported"
. – phimuemue