Summary
A Discriminated union for 10 types.
- Namespace
- FunctionalSharp
.DiscriminatedUnions - Base Types
-
- object
graph TD
Base0["object"]-->Type
Type["DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10>"]
class Type type-node
Syntax
[Serializable]
public class DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9, Type10>
Attributes
| Type | Description |
|---|---|
| Serializable |
Type Parameters
| Name | Description |
|---|---|
| Type1 | Type1 |
| Type2 | Type2 |
| Type3 | Type3 |
| Type4 | Type4 |
| Type5 | Type5 |
| Type6 | Type6 |
| Type7 | Type7 |
| Type8 | Type8 |
| Type9 | Type9 |
| Type10 | Type10 |
Constructors
| Name | Summary |
|---|---|
| DiscriminatedUnion |
Private constructor to support serialization. |
| DiscriminatedUnion |
Runs Actions for the matched types. |
| DiscriminatedUnion |
Creates a new Discriminated union of with Type1 |
| DiscriminatedUnion |
Creates a new Discriminated union of with Type10 |
| DiscriminatedUnion |
Creates a new Discriminated union of with Type2 |
| DiscriminatedUnion |
Creates a new Discriminated union of with Type3 |
| DiscriminatedUnion |
Creates a new Discriminated union of with Type4 |
| DiscriminatedUnion |
Creates a new Discriminated union of with Type5 |
| DiscriminatedUnion |
Creates a new Discriminated union of with Type6 |
| DiscriminatedUnion |
Creates a new Discriminated union of with Type7 |
| DiscriminatedUnion |
Creates a new Discriminated union of with Type8 |
| DiscriminatedUnion |
Creates a new Discriminated union of with Type9 |
Fields
| Name | Constant Value | Summary |
|---|---|---|
| Item1 |
The storage for type1.
|
|
| Item10 |
The storage for type10.
|
|
| Item2 |
The storage for type2.
|
|
| Item3 |
The storage for type3.
|
|
| Item4 |
The storage for type4.
|
|
| Item5 |
The storage for type5.
|
|
| Item6 |
The storage for type6.
|
|
| Item7 |
The storage for type7.
|
|
| Item8 |
The storage for type8.
|
|
| Item9 |
The storage for type9.
|
|
| tag |
The tag indicating what item is actually stored.
|
Methods
| Name | Value | Summary |
|---|---|---|
| Match |
void |
Runs Actions for the matched types.
|
| Match |
ReturnType |
Transforms the union into a new type using the given functions for the transformation.
|
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
|
