Skip to content

EitherSyntaxOps<A>

extension EitherSyntaxOps<A> on A

Operations for any value to lift it into an Either.

Methods

asLeft() extension

Either<A, B> asLeft<B>()

Creates a Left instance with this value.

Available on A, provided by the EitherSyntaxOps<A> extension

Implementation
dart
Either<A, B> asLeft<B>() => Either.left(this);

asRight() extension

Either<B, A> asRight<B>()

Creates a Right instance with this value.

Available on A, provided by the EitherSyntaxOps<A> extension

Implementation
dart
Either<B, A> asRight<B>() => Either.right(this);