Summary
The interface for an option type. It Might hold a value, if so it is Some of Type T. Else it is implemented by None of type T.
- Namespace
- FunctionalSharp
.OptionTypes
graph TD
Type["IOption<T>"]
class Type type-node
Syntax
public interface IOption<T>
Type Parameters
Name | Description |
---|---|
T |
Methods
Name | Value | Summary |
---|---|---|
IfNotNullDo |
void |
Performs the Action withValue if a value is available.
|
Match |
void |
Depending on weither the option actually holds a value the withValue is executed or the withoutValue is executed.
|
Match |
TResult |
depending on weither the option holds a value or not the given function is executed to produce a returnvalue.
|
Match |
TResult |
depending on weither the option holds a value or not the given values are returned.
|
ToNullable |
T |
Converts the IOption to T.
|
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
|