DiscriminatedUnionList<Type1, Type2, Type3, Type4, Type5> Class

Summary

Represents a list of Discriminated unions. Using this list you can add items without having to specify the union type.
Namespace
FunctionalSharp.DiscriminatedUnions
Interfaces
  • IList<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>
  • ICollection<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>
  • IList
  • ICollection
  • IReadOnlyList<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>
  • IReadOnlyCollection<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>
  • IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>
  • IEnumerable
Base Types
  • object
  • List<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>
graph TD Base0["List<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>"]-->Type Base1["object"]-->Base0 Interface0["IList<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>"]-.->Type Interface1["ICollection<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>"]-.->Type Interface2["IList"]-.->Type Interface3["ICollection"]-.->Type Interface4["IReadOnlyList<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>"]-.->Type Interface5["IReadOnlyCollection<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>"]-.->Type Interface6["IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>"]-.->Type Interface7["IEnumerable"]-.->Type Type["DiscriminatedUnionList<Type1, Type2, Type3, Type4, Type5>"] class Type type-node

Syntax

[Serializable]
public class DiscriminatedUnionList<Type1, Type2, Type3, Type4, Type5> : 
    List<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>, 
    IList<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>, 
    ICollection<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>, IList, ICollection, 
    IReadOnlyList<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>, 
    IReadOnlyCollection<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>, 
    IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>, IEnumerable

Attributes

Type Description
SerializableAttribute

Type Parameters

Name Description
Type1 Type1
Type2 Type2
Type3 Type3
Type4 Type4
Type5 Type5

Methods

Name Value Summary
Add(Type1) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type2) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type3) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type4) void
Adds the object to the end of the DiscriminatedUnionList
Add(Type5) void
Adds the object to the end of the DiscriminatedUnionList
AddRange(IEnumerable<Type1>) void
Adds the object to the end of the DiscriminatedUnionList
AddRange(IEnumerable<Type2>) void
Adds the object to the end of the DiscriminatedUnionList
AddRange(IEnumerable<Type3>) void
Adds the object to the end of the DiscriminatedUnionList
AddRange(IEnumerable<Type4>) void
Adds the object to the end of the DiscriminatedUnionList
AddRange(IEnumerable<Type5>) void
Adds the object to the end of the DiscriminatedUnionList
Merge<TypeToMerge>(IEnumerable<TypeToMerge>) DiscriminatedUnionList<Type1, Type2, Type3, Type4, Type5, TypeToMerge>
Merges a type into the existing discriminated union list.

Extension Methods

Name Value Summary
Add<Type1, Type2, Type3, Type4, Type5>(Type1) void
Adds the object to the end of the DiscriminatedUnionList
Add<Type1, Type2, Type3, Type4, Type5>(Type2) void
Adds the object to the end of the DiscriminatedUnionList
Add<Type1, Type2, Type3, Type4, Type5>(Type3) void
Adds the object to the end of the DiscriminatedUnionList
Add<Type1, Type2, Type3, Type4, Type5>(Type4) void
Adds the object to the end of the DiscriminatedUnionList
Add<Type1, Type2, Type3, Type4, Type5>(Type5) void
Adds the object to the end of the DiscriminatedUnionList
AddRange<Type1, Type2, Type3, Type4, Type5>(IEnumerable<Type1>) void
Adds a Enumerable of items to the list.
AddRange<Type1, Type2, Type3, Type4, Type5>(IEnumerable<Type2>) void
Adds a Enumerable of items to the list.
AddRange<Type1, Type2, Type3, Type4, Type5>(IEnumerable<Type3>) void
Adds a Enumerable of items to the list.
AddRange<Type1, Type2, Type3, Type4, Type5>(IEnumerable<Type4>) void
Adds a Enumerable of items to the list.
AddRange<Type1, Type2, Type3, Type4, Type5>(IEnumerable<Type5>) void
Adds a Enumerable of items to the list.
Match<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>() PatternMatchContext<T>
Starts a pattern match. Subsequent calls to With() need to be used to specify conditions
Match<DiscriminatedUnionList<Type1, Type2, Type3, Type4, Type5>>() PatternMatchSingleContext<T>
Starts a pattern match for a single value. Subsequent calls to With() need to be used to specify conditions
Match<Type1, Type2, Type3, Type4, Type5, ReturnType>(Func<Type1, ReturnType>, Func<Type2, ReturnType>, Func<Type3, ReturnType>, Func<Type4, ReturnType>, Func<Type5, ReturnType>) IEnumerable<ReturnType>
Matches the specific types and uses the given functions to tranform into s ingle returntype.
Match<Type1, Type2, Type3, Type4, Type5>(Action<Type1>, Action<Type2>, Action<Type3>, Action<Type4>, Action<Type5>) void
Matches the specific types and executes the given action for them.
MatchDiscriminated<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>() DiscriminatedPatternMatchContext<T>
Merge<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9>(IEnumerable<Type2>, IEnumerable<Type3>, IEnumerable<Type4>, IEnumerable<Type5>, IEnumerable<Type6>, IEnumerable<Type7>, IEnumerable<Type8>, IEnumerable<Type9>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8, Type9>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>, Type2, Type3, Type4, Type5, Type6, Type7, Type8>(IEnumerable<Type2>, IEnumerable<Type3>, IEnumerable<Type4>, IEnumerable<Type5>, IEnumerable<Type6>, IEnumerable<Type7>, IEnumerable<Type8>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6, Type7, Type8>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>, Type2, Type3, Type4, Type5, Type6, Type7>(IEnumerable<Type2>, IEnumerable<Type3>, IEnumerable<Type4>, IEnumerable<Type5>, IEnumerable<Type6>, IEnumerable<Type7>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6, Type7>>
Merges to given collections into a discriminated union collection.
Merge<Type1, Type2, Type3, Type4, Type5, Type6>(IEnumerable<Type6>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6>>
Merges the item intos the existing discriminatedunions resulting in a new enumerable of discriminated unions with the type of the items as a new option.
Merge<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>, Type2, Type3, Type4, Type5, Type6>(IEnumerable<Type2>, IEnumerable<Type3>, IEnumerable<Type4>, IEnumerable<Type5>, IEnumerable<Type6>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>, Type2, Type3, Type4, Type5>(IEnumerable<Type2>, IEnumerable<Type3>, IEnumerable<Type4>, IEnumerable<Type5>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>, Type2, Type3, Type4>(IEnumerable<Type2>, IEnumerable<Type3>, IEnumerable<Type4>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>, Type2, Type3>(IEnumerable<Type2>, IEnumerable<Type3>) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3>>
Merges to given collections into a discriminated union collection.
Merge<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>, Type2>(IEnumerable<Type2>) IEnumerable<DiscriminatedUnion<Type1, Type2>>
Merges to given collections into a discriminated union collection.
MergeItem<Type1, Type2, Type3, Type4, Type5, Type6>(Type6) IEnumerable<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5, Type6>>
Merges the item into the existing discriminatedunions resulting in a new enumerable of discriminated unions with the type of the item as a new option.
SafeSingle<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>>(Func<DiscriminatedUnion<Type1, Type2, Type3, Type4, Type5>, bool>) DiscriminatedUnion<T, MultipleResultsException, EmptySequenceException>
provides a mechanism to use Single on a collection that returns a discriminated union instead of an exception.
ToOption<DiscriminatedUnionList<Type1, Type2, Type3, Type4, Type5>>() IOption<T>
Turns the type T into an option type.