FSharp.Core


ValueOption<'T> Type

The type of optional values, represented as structs.

Use the constructors ValueSome and ValueNone to create values of this type. Use the values in the ValueOption module to manipulate values of this type, or pattern match against the values directly.

Union cases

Union case Description

ValueNone

Full Usage: ValueNone

The representation of "No value"

ValueSome 'T

Full Usage: ValueSome 'T

Parameters:
    Item : 'T - The input value.

The representation of "Value of type 'T"

Item : 'T

The input value.

Instance members

Instance member Description

this.IsNone

Full Usage: this.IsNone

Returns: bool

Return 'true' if the value option is a 'ValueNone' value.

Returns: bool

this.IsSome

Full Usage: this.IsSome

Returns: bool

Return 'true' if the value option is a 'ValueSome' value.

Returns: bool

this.Value

Full Usage: this.Value

Returns: 'T

Get the value of a 'ValueSome' option. An InvalidOperationException is raised if the option is 'ValueNone'.

Returns: 'T