Skip to content

EitherTuple4Ops<E, T1, T2, T3, T4>

extensionEitherTuple4Ops<E, T1, T2, T3, T4>onEither<E,Record>

Provides additional functions on an Either where the right value is a 4 element tuple.

Methods

ensureN() extension

Either<E,Record>ensureN(boolFunction(T1,T2,T3,T4)p,EFunction()onFailure,);

Available on Either<A, B>, provided by the EitherTuple4Ops<E, T1, T2, T3, T4> extension

Implementation
dart
Either<E, (T1, T2, T3, T4)> ensureN(
  Function4<T1, T2, T3, T4, bool> p,
  Function0<E> onFailure,
) => ensure(p.tupled, onFailure);

filterOrElseN() extension

Either<E,Record>filterOrElseN(boolFunction(T1,T2,T3,T4)p,EFunction()zero,);

Available on Either<A, B>, provided by the EitherTuple4Ops<E, T1, T2, T3, T4> extension

Implementation
dart
Either<E, (T1, T2, T3, T4)> filterOrElseN(
  Function4<T1, T2, T3, T4, bool> p,
  Function0<E> zero,
) => filterOrElse(p.tupled, zero);

flatMapN() extension

Either<E,T5>flatMapN<T5>(Either<E,T5>Function(T1,T2,T3,T4)f,);

Available on Either<A, B>, provided by the EitherTuple4Ops<E, T1, T2, T3, T4> extension

Implementation
dart
Either<E, T5> flatMapN<T5>(Function4<T1, T2, T3, T4, Either<E, T5>> f) => flatMap(f.tupled);

foldN() extension

T5foldN<T5>(T5Function(E)f,T5Function(T1,T2,T3,T4)g,);

Available on Either<A, B>, provided by the EitherTuple4Ops<E, T1, T2, T3, T4> extension

Implementation
dart
T5 foldN<T5>(
  Function1<E, T5> f,
  Function4<T1, T2, T3, T4, T5> g,
) => fold(f, g.tupled);

foreachN() extension

voidforeachN(voidFunction(T1,T2,T3,T4)f)

Available on Either<A, B>, provided by the EitherTuple4Ops<E, T1, T2, T3, T4> extension

Implementation
dart
void foreachN(Function4<T1, T2, T3, T4, void> f) => foreach(f.tupled);

mapN() extension

Either<E,T5>mapN<T5>(T5Function(T1,T2,T3,T4)f)

Available on Either<A, B>, provided by the EitherTuple4Ops<E, T1, T2, T3, T4> extension

Implementation
dart
Either<E, T5> mapN<T5>(Function4<T1, T2, T3, T4, T5> f) => map(f.tupled);