left<L, R> function

Either<L, R> left<L, R>(
  1. L left
)

Creates a new instance of Left with a value of type L.

The value of left is used to create the instance of Left.

The resulting instance of Left is returned as an instance of Either with R set to null.

Example:

final myEither = left<String, int>('hello');

In this example, a new instance of Left is created with the value 'hello' of type String. The resulting instance is then returned as an instance of Either with R set to null.

Returns an instance of Either with L set to left and R set to null.

Implementation

Either<L, R> left<L, R>(L left) => Left(left);