Extension and utility methods for Nullable<T>.
Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
See Also: Inherited members from object.
⊟ Public Methods
staticJust<T> (this Nullable<T>) : Maybe<T> Create a new Cadenza.Maybe<T> instance initialized to a specified value. The returned value will not be Maybe<T>.Nothing. staticToMaybe<T> (this Nullable<T>) : Maybe<T> Create a new Cadenza.Maybe<T> instance initialized to a specified value. The returned value may be Maybe<T>.Nothing.
⊟ Just<T> Generic Method
Create a new Cadenza.Maybe<T> instance initialized to a specified value. The returned value will not be Maybe<T>.Nothing.
⊟ See Also
⊟ Type Parameters
- T
- The type to convert into a Cadenza.Maybe<T>.
⊟ Parameters
- self
- A value of type Nullable<T> to convert into a Cadenza.Maybe<T>.
⊟ Returns
A new Cadenza.Maybe<T> instance initialized to a specified value.
The returned value will not be Maybe<T>.Nothing.
⊟ Exceptions
Type Reason ArgumentNullException selfs Nullable<T>.HasValue property is false. ⊟ Remarks
Use this method when you want to ensure that Cadenza.Maybe<T> instance is created in which Maybe<T>.Value will not throw.⊟ Requirements
Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ ToMaybe<T> Generic Method
Create a new Cadenza.Maybe<T> instance initialized to a specified value. The returned value may be Maybe<T>.Nothing.
⊟ See Also
⊟ Type Parameters
- T
- The type to convert into a Cadenza.Maybe<T>.
⊟ Parameters
- self
- A value of type Nullable<T> to convert into a Cadenza.Maybe<T>.
⊟ Returns
A new Cadenza.Maybe<T> instance initialized to a specified value.
Note: The value returned may be Maybe<T>.Nothing.⊟ Remarks
Use this method when you want to ensure that a possibly invalid Cadenza.Maybe<T> instance is created. if Nullable<T>.HasValue is false, then Maybe<T>.Nothing will be returned; otherwise, a new Cadenza.Maybe<T> will be created containing the value within self.⊟ Requirements
Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0