Constructor Maybe
Maybe(T)
Creates an instance that represents the specified value.
Declaration
public Maybe(T value)
Parameters
Type | Name | Description |
---|---|---|
T | value | The value represented by this instance. |
Remarks
If {T} is a 'nullable' type (reference type or Nullable{T}) and value
is null, then an 'empty' instance is returned. Otherwise a non-empty instance containing value
is returned.
If you want an empty instance of a non-nullable type use Maybe{T}.Nothing (preferred), or new Maybe{T}. New Maybe{T}(default(T)) will return a non-empty instance with the default value of that type.