Click or drag to resize
OptionalValueModule Methods

The OptionalValueModule type exposes the following members.

Methods
  NameDescription
Public methodStatic member|Missing|Present|T
Complete active pattern that can be used to pattern match on `OptionalValue<T>`. For example: let optVal = OptionalValue(42) match optVal with | OptionalValue.Missing -> printfn "Empty" | OptionalValue.Present(v) -> printfn "Contains %d" v
Public methodStatic memberasOptionT
Turns the `OptionalValue<T>` into a corresponding standard F# `option<T>` value
Public methodStatic memberBindT, R
If the `OptionalValue<T>` does not contain a value, then returns a new `OptionalValue<R>.Empty`. Otherwise, returns the result of applying the function `f` to the value contained in the provided optional value.
Public methodStatic memberdefaultArgT
Returns the value `def` when the argument is missing, otherwise returns its value
Public methodStatic membergetT
Get the value stored in the specified optional value. If a value is not available, throws an exception. (This is equivalent to the `Value` property)
Public methodStatic memberMapT, R
If the `OptionalValue<T>` does not contain a value, then returns a new `OptionalValue<R>.Empty`. Otherwise, returns the result `OptionalValue<R>` containing the result of applying the function `f` to the value contained in the provided optional value.
Public methodStatic memberMap2T1, T2, R
If both of the arguments contain value, apply the specified function to their values and return `OptionalValue<R>` with the result. Otherwise return `OptionalValue.Missing`.
Public methodStatic memberOfNullableT
Creates `OptionalValue<T>` from a .NET `Nullable<T>` type.
Public methodStatic memberofOptionT
Turns a standard F# `option<T>` value into a corresponding `OptionalValue<T>`
Public methodStatic memberOfTupleT
Creates `OptionalValue<T>` from a tuple of type `bool * 'T`. This function can be used with .NET methods that use `out` arguments. For example: Int32.TryParse("42") |> OptionalValue.ofTuple
Top
See Also