Skip to content

Tuple18IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18>

extension Tuple18IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> on Record

Provides additional functions on a tuple of 18 IOs.

Properties

parTupled extension no setter

IO<Record> get parTupled

Creates a new IO that will return the tuple of all items if they all evaluate successfully. If any item fails or is canceled, the first instance encountered will be returned. Items are evaluated asynchronously.

Available on Record, provided by the Tuple18IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> extension

Implementation
dart
IO<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)>
get parTupled => IO.both(init.parTupled, last).map((t) => t.$1.appended(t.$2));

tupled extension no setter

IO<Record> get tupled

Creates a new IO that will return the tuple of all items if they all evaluate successfully. If any item fails or is canceled, the first instance encountered will be returned. Each item is evaluated synchronously.

Available on Record, provided by the Tuple18IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> extension

Implementation
dart
IO<(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18)>
get tupled => init.tupled.flatMap((x) => last.map(x.appended));

Methods

flatMapN() extension

IO<T19> flatMapN<T19>(
  IO<T19> Function(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) fn,
)

Creates a new IO that applies fn to the values of each respective tuple member if all IOs succeed. If any item fails or is canceled, the first instance encountered will be returned. Each item is evaluated synchronously.

Available on Record, provided by the Tuple18IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> extension

Implementation
dart
IO<T19> flatMapN<T19>(
  Function18<
    T1,
    T2,
    T3,
    T4,
    T5,
    T6,
    T7,
    T8,
    T9,
    T10,
    T11,
    T12,
    T13,
    T14,
    T15,
    T16,
    T17,
    T18,
    IO<T19>
  >
  fn,
) => tupled.flatMap(fn.tupled);

mapN() extension

IO<T19> mapN<T19>(
  T19 Function(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) fn,
)

Creates a new IO that applies fn to the values of each respective tuple member if all IOs succeed. If any item fails or is canceled, the first instance encountered will be returned. Each item is evaluated synchronously.

Available on Record, provided by the Tuple18IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> extension

Implementation
dart
IO<T19> mapN<T19>(
  Function18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>
  fn,
) => tupled.map(fn.tupled);

parMapN() extension

IO<T19> parMapN<T19>(
  T19 Function(T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18) fn,
)

Creates a new IO that applies fn to the values of each respective tuple member if all IOs succeed. If any item fails or is canceled, the first instance encountered will be returned. Each item is evaluated synchronously.

Available on Record, provided by the Tuple18IOOps<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18> extension

Implementation
dart
IO<T19> parMapN<T19>(
  Function18<T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12, T13, T14, T15, T16, T17, T18, T19>
  fn,
) => parTupled.map(fn.tupled);