Idiomatic F # has no null values ββat all, so what will it be? In F #, the most common way to simulate a lack of value is to use option .
When I need to interact with .NET code that can return null , I convert it to a parameter as soon as possible using this function:
let toOption (x : obj) = match x with | null -> None | _ -> Some x
Once you have your value modeled as an option , you can compose it, for example. Option.map , and this serves the same purpose (but better and safer) than the proposed C # operator.
source share