Option.Some(4);
Option.None<int>();
Option.FromNullable("42") == Option.Some("42") // True
string value = null;
Option.FromNullable(value) == Option.None<string>(); // True
If an instance of Some
,
applies func
to the contained value,
and returns the result in an new instance of Some
.
If None
, returns None
.
If an instance of Some
,
applies func
to the contained value.
If None
, do nothing.
Returns the contained value if an instance of Some
,
otherwise returns value
.