open System let doesNotWorkRead<'a> str : 'a option = match typeof<'a> with | t when t = typeof -> Int32.Parse str |> Some | t when t = typeof -> Some str | _ -> None let read<'a> str : 'a = match typeof<'a> with | t when t = typeof -> Int32.Parse str |> box |> unbox<'a> | t when t = typeof -> str |> box |> unbox<'a> | _ -> failwith "The programmers proof engine failed"