Home
Insert
Update snippet 'Nullable to Option'
Title
Passcode
Description
it's allways a pain to work with F#'s Option values outside of F# - there you've got the Nullable-class this is a short snippet to convert Nullable<'a> to 'a option
Source code
let NullableToOption (n : System.Nullable<_>) = if n.HasValue then Some n.Value else None
Tags
nullable
option
nullable
option
Author
Link
Reference NuGet packages
If your snippet has external dependencies, enter the names of NuGet packages to reference, separated by a comma (
#r
directives are not required).
Update