Summary
A representation for an IOption without a value.
- Namespace
- FunctionalSharp
.OptionTypes - Interfaces
-
- IOption
<T>
- IOption
- Base Types
-
- object
graph TD
Base0["object"]-->Type
Interface0["IOption<T>"]-.->Type
Type["None<T>"]
class Type type-node
Syntax
[Serializable]
public class None<T> : IOption<T>
Attributes
| Type | Description |
|---|---|
| Serializable |
Type Parameters
| Name | Description |
|---|---|
| T |
Constructors
| Name | Summary |
|---|---|
| None |
Creates a new None of T. The type T must be nullable, if not an exception will be thrown |
Methods
| Name | Value | Summary |
|---|---|---|
| IfNotNullDo |
void |
Does nothing since None doesnt hold a value.
|
| Match |
void |
Executes the action withoutValue.
|
| Match |
TResult |
returns the value generated by running withoutValue.
|
| Match |
TResult |
returns the value in the parameter withoutValue.
|
| ToNullable |
T |
Returns null.
|
| ToString |
string |
returns a string "null value for" with the name of the type.
|
Extension Methods
| Name | Value | Summary |
|---|---|---|
| Match |
Pattern |
Starts a pattern match for a single value. Subsequent calls to With() need to be used to specify conditions
|
| ToOption |
IOption |
Turns the type T into an option type.
From OptionExtensions
|
