// ets_tracing: off import type { NonEmptyArray } from "../Collections/Immutable/NonEmptyArray/index.js" import * as Tp from "../Collections/Immutable/Tuple/index.js" import type { _E, _R, ForcedTuple } from "../Utils/index.js" import type { Async } from "./core.js" import { map_ } from "./core.js" import { collectAll, collectAllPar } from "./excl-forEach.js" export type TupleA>> = { [K in keyof T]: [T[K]] extends [Async] ? A : never } /** * Like `forEach` + `identity` with a tuple type * * @ets_trace call */ export function tuple>>( ...t: T ): Async<_R, _E, ForcedTuple>> { return map_(collectAll(t), (x) => Tp.tuple(...x)) as any } /** * Like sequenceT but parallel, same as `forEachPar` + `identity` with a tuple type * * @ets_trace call */ export function tuplePar>>( ...t: T ): Async<_R, _E, ForcedTuple>> { return map_(collectAllPar(t), (x) => Tp.tuple(...x)) as any }