Saturday, 7 September 2013

How can I pass an Option value along?

How can I pass an Option value along?

I am wondering if there is a way to pass an Option value along from the
matching pattern without recreating it?
var funA x = Some(x)
var funB x =
match funA x with
| Option(y) -> Option(y) // <---- Recreating the Option value. Can I
return the very same one?
| _ -> failwith "Whatever"

No comments:

Post a Comment