let f (o:obj option) =
o
|> Option.bind(
function
| :? byte[] as b -> Some b
| _ -> None)
but it does not compile
the following may fail at runtime, and not only to be used if it is the correct type, so that it does not match the desired behavior
let f (o:obj option) = o |> Option.map(fun b -> b :?> byte[])
How can you try a objto byte[]?
source
share