Left<L, R> class final

Represents a failure or error case.

Two Lefts are equal when they have exactly the same runtime type (including type arguments) and equal values, so == is symmetric: Left<String, int>('x') never equals Left<String, num>('x').

Inheritance
Available extensions

Constructors

Left(L value)
Creates a Left with the given value. If EitherConfig.errorLogger is set and in debug mode, logs a non-null error value.

Properties

hashCode → int
The hash code for this object.
no setteroverride
isLeft → bool

Available on Either<L, R>, provided by the EitherExtensions extension

Returns true if this is a Left.
no setter
isRight → bool

Available on Either<L, R>, provided by the EitherExtensions extension

Returns true if this is a Right.
no setter
left → L?

Available on Either<L, R>, provided by the EitherExtensions extension

Returns the Left value if present, otherwise null.
no setter

Available on Either<L, R>, provided by the EitherExtensions extension

Returns the Right value if present, otherwise null.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
value → L
The failure held by this Left.
final

Methods

fold<T>(T leftFn(L l), T rightFn(R r)) → T
Applies leftFn if this is a Left, or rightFn if this is a Right.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override

Operators

operator ==(Object other) → bool
The equality operator.
override