Is there a better way how to do this?
let intOption = Some(123) let longOption = match intOption with | Some x -> Some(int64 x ) | None -> None
I need to convert option of int to option of int64 .
option of int
option of int64
Option.map does exactly what you need.
Option.map
intOption |> Option.map int64
The function you are looking for is Option.map :
let longOption = Option.map int64 intOption