right<L, R> function

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

Creates a new instance of Right with a value of type R.

The value of right is used to create the instance of Right. The resulting instance of Right is returned as an instance of Either with L set to null.

Example:

final myEither = right<String, int>(42);

In this example, a new instance of Right is created with the value 42 of type int. The resulting instance is then returned as an instance of Either with L set to null.

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

Implementation

Either<L, R> right<L, R>(R right) => Right(right);