Union<L, R> class abstract

A monad that represents a union type.

Mixed-in types

Constructors

Union()
Creates a Union.
Union.left(L left)
Creates a Union with the given value of type L.
factory
Union.right(R right)
Creates a Union with the given value of type R.
factory

Properties

fields List
The fields used to determine equality.
no setteroverride
hashCode int
The hash code for this object.
no setterinherited
left bool
Returns true if this Union contains a value which type is L.
no setter
Returns true if this Union contains a value which type is R.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
value → dynamic
The value of this Union.
no setter

Methods

map<T>(T left(L), T right(R)) → T
Maps the value of this Union using left if the value is of type L, or right if the value is of type R.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited