type Option<'a> = | Some of 'a | None let GetValue (obj : Option<'a>) : string = match obj with | Some b -> match box b with | :? string as greeting -> box.ToString() | _ -> "unknown" | None -> "None"