DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, BaseType> Class

Summary

A Discriminated union for 6 types.
Namespace
FunctionalSharp.DiscriminatedUnions
Base Types
  • object
  • DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6>
graph TD Base0["DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6>"]-->Type Base1["object"]-->Base0 Type["DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, BaseType>"] class Type type-node

Syntax

[Serializable]
public class DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, BaseType> : 
    DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6>
    
    where Type1 : BaseType where Type2 : BaseType where Type3 : BaseType where Type4 : BaseType where Type5 : BaseType where Type6 : BaseType

Attributes

Type Description
SerializableAttribute

Type Parameters

Name Description
Type1 Type1
Type2 Type2
Type3 Type3
Type4 Type4
Type5 Type5
Type6 Type6
BaseType

Constructors

Name Summary
DiscriminatedUnionWithBase(Type1) Creates a new Discriminated union of with Type1
DiscriminatedUnionWithBase(Type2) Creates a new Discriminated union of with Type2
DiscriminatedUnionWithBase(Type3) Creates a new Discriminated union of with Type3
DiscriminatedUnionWithBase(Type4) Creates a new Discriminated union of with Type4
DiscriminatedUnionWithBase(Type5) Creates a new Discriminated union of with Type5
DiscriminatedUnionWithBase(Type6) Creates a new Discriminated union of with Type6

Properties

Name Value Summary
AnyType BaseType
Gets any type by returning the basetype.

Extension Methods

Name Value Summary
Match<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, BaseType>>() PatternMatchSingleContext<T>
Starts a pattern match for a single value. Subsequent calls to With() need to be used to specify conditions
ToOption<DiscriminatedUnionWithBase<Type1, Type2, Type3, Type4, Type5, Type6, BaseType>>() IOption<T>
Turns the type T into an option type.