FSharpPlus


Nullable Module

Additional operations on Nullable

Functions and values

Function or value Description

Nullable.bind f n

Full Usage: Nullable.bind f n

Parameters:
    f : 'a -> Nullable<'b> - The value binding function.
    n : Nullable<'a> - The Nullable value.

Returns: Nullable<'b>

Monadic Bind; Transforms the value inside a Nullable to a Nullable using a specified binding function.

f : 'a -> Nullable<'b>

The value binding function.

n : Nullable<'a>

The Nullable value.

Returns: Nullable<'b>

Nullable.count n

Full Usage: Nullable.count n

Parameters:
    n : Nullable<'a> - The Nullable value.

Returns: int 1 if the Nullable has a value, 0 otherwise.

Returns the number of values in the Nullable (0 or 1).

n : Nullable<'a>

The Nullable value.

Returns: int

1 if the Nullable has a value, 0 otherwise.

Nullable.defaultValue defValue n

Full Usage: Nullable.defaultValue defValue n

Parameters:
    defValue : 'a - The value to use if the Nullable does not have a value.
    n : Nullable<'a> - The Nullable value.

Returns: 'a The value inside the Nullable or defValue.

Returns the value inside a Nullable if it has one, otherwise returns defValue.

defValue : 'a

The value to use if the Nullable does not have a value.

n : Nullable<'a>

The Nullable value.

Returns: 'a

The value inside the Nullable or defValue.

Nullable.defaultWith defThunk n

Full Usage: Nullable.defaultWith defThunk n

Parameters:
    defThunk : unit -> 'a - The function that returns a default value.
    n : Nullable<'a> - The Nullable value.

Returns: 'a The value inside the Nullable or the result of defThunk.

Returns the value inside a Nullable if it has one, otherwise returns the result of evaluating defThunk.

defThunk : unit -> 'a

The function that returns a default value.

n : Nullable<'a>

The Nullable value.

Returns: 'a

The value inside the Nullable or the result of defThunk.

Nullable.exists pred n

Full Usage: Nullable.exists pred n

Parameters:
    pred : 'a -> bool - Function to test against the inner value.
    n : Nullable<'a> - The Nullable value.

Returns: bool True if the Nullable contains a value that matches the predicate, false otherwise.

Returns whether a Nullable contains a value for which the given predicate returns true.

pred : 'a -> bool

Function to test against the inner value.

n : Nullable<'a>

The Nullable value.

Returns: bool

True if the Nullable contains a value that matches the predicate, false otherwise.

Nullable.filter pred n

Full Usage: Nullable.filter pred n

Parameters:
    pred : 'a -> bool - Function that returns whether the value in the Nullable should remain.
    n : Nullable<'a> - The Nullable value.

Returns: Nullable<'a> The original Nullable value if the predicate matched the value, empty Nullable otherwise.

Filters the value in a Nullable with the given predicate.

pred : 'a -> bool

Function that returns whether the value in the Nullable should remain.

n : Nullable<'a>

The Nullable value.

Returns: Nullable<'a>

The original Nullable value if the predicate matched the value, empty Nullable otherwise.

Nullable.fold f state n

Full Usage: Nullable.fold f state n

Parameters:
    f : 'a -> 'b -> 'a - A function to update the state data when given a value from the Nullable.
    state : 'a - The initial state.
    n : Nullable<'b> - The Nullable value.

Returns: 'a The new state if the Nullable contained a value, the original state otherwise.

Updates state data with an update function and the value from a Nullable if it has one.

f : 'a -> 'b -> 'a

A function to update the state data when given a value from the Nullable.

state : 'a

The initial state.

n : Nullable<'b>

The Nullable value.

Returns: 'a

The new state if the Nullable contained a value, the original state otherwise.

Nullable.foldBack f state n

Full Usage: Nullable.foldBack f state n

Parameters:
    f : 'a -> 'b -> 'b - A function to update the state data when given a value from the Nullable.
    state : 'b - The initial state.
    n : Nullable<'a> - The Nullable value.

Returns: 'b The new state if the Nullable contained a value, the original state otherwise.

Fold, but the update function has reversed arguments.

f : 'a -> 'b -> 'b

A function to update the state data when given a value from the Nullable.

state : 'b

The initial state.

n : Nullable<'a>

The Nullable value.

Returns: 'b

The new state if the Nullable contained a value, the original state otherwise.

Nullable.forall pred n

Full Usage: Nullable.forall pred n

Parameters:
    pred : 'a -> bool - Function to test against the inner value.
    n : Nullable<'a> - The Nullable value.

Returns: bool True if the Nullable is empty or the value matches the predicate, false otherwise.

Returns whether a Nullable is empty or its value passes the given predicate. Like exists, but returns true when there is no value.

pred : 'a -> bool

Function to test against the inner value.

n : Nullable<'a>

The Nullable value.

Returns: bool

True if the Nullable is empty or the value matches the predicate, false otherwise.

Nullable.hasValue n

Full Usage: Nullable.hasValue n

Parameters:
    n : Nullable<'a> - The Nullable value.

Returns: bool True if the Nullable has a value, false otherwise.

Returns whether a Nullable has a value.

n : Nullable<'a>

The Nullable value.

Returns: bool

True if the Nullable has a value, false otherwise.

Nullable.isNull n

Full Usage: Nullable.isNull n

Parameters:
    n : Nullable<'a> - The Nullable value.

Returns: bool True if the Nullable does not have a value, false otherwise.

Returns whether a Nullable is empty.

n : Nullable<'a>

The Nullable value.

Returns: bool

True if the Nullable does not have a value, false otherwise.

Nullable.iter f n

Full Usage: Nullable.iter f n

Parameters:
    f : 'a -> 'b - The function to apply to the value of a Nullable.
    n : Nullable<'a> - The Nullable value.

Invokes a side-effect function to the value of a Nullable if present and ignores the result.

f : 'a -> 'b

The function to apply to the value of a Nullable.

n : Nullable<'a>

The Nullable value.

Nullable.map f n

Full Usage: Nullable.map f n

Parameters:
    f : 'a -> 'b - The value mapping function.
    n : Nullable<'a> - The Nullable value.

Returns: Nullable<'b>

Transforms the value inside a Nullable by using a specified mapping function.

f : 'a -> 'b

The value mapping function.

n : Nullable<'a>

The Nullable value.

Returns: Nullable<'b>

Nullable.toArray n

Full Usage: Nullable.toArray n

Parameters:
    n : Nullable<'a> - The Nullable value.

Returns: 'a[] An array that contains the value in the Nullable if there is one, or an empty array.

Converts a Nullable to an array with 0 or 1 items.

n : Nullable<'a>

The Nullable value.

Returns: 'a[]

An array that contains the value in the Nullable if there is one, or an empty array.

Nullable.toList n

Full Usage: Nullable.toList n

Parameters:
    n : Nullable<'a> - The Nullable value.

Returns: 'a list A list that contains the value in the Nullable if there is one, or an empty list.

Converts a Nullable to a list with 0 or 1 items.

n : Nullable<'a>

The Nullable value.

Returns: 'a list

A list that contains the value in the Nullable if there is one, or an empty list.