left<A, B> function
- A value
Wraps the given value
in a Left
, indicating the presence of a value of type A
.
Example usage:
final either = left<int, String>(42); // This will be Left(42)
Implementation
Either<A, B> left<A, B>(A value) {
return Left<A, B>(value);
}