// ets_tracing: off import * as T from "@effect-ts/system/Effect" import * as S from "@effect-ts/system/Sync" import * as A from "./operations.js" /** * Applies the function f to each element of the Array and returns the results in a new B[] */ export function mapEffect_( self: A.Array, f: (a: A) => T.Effect ) { return T.map_(T.forEach_(self, f), A.from) } /** * Applies the function f to each element of the Array and returns the results in a new B[] * * @ets_data_first mapEffect_ */ export function mapEffect(f: (a: A) => T.Effect) { return (self: A.Array) => mapEffect_(self, f) } /** * Applies the function f to each element of the Array and returns the results in a new B[] */ export function mapEffectPar_( self: A.Array, f: (a: A) => T.Effect ) { return T.map_(T.forEachPar_(self, f), A.from) } /** * Applies the function f to each element of the Array and returns the results in a new B[] * * @ets_data_first mapEffectPar_ */ export function mapEffectPar(f: (a: A) => T.Effect) { return (self: A.Array) => mapEffectPar_(self, f) } /** * Applies the function f to each element of the Array and returns the results in a new B[] */ export function mapEffectParN_( self: A.Array, n: number, f: (a: A) => T.Effect ) { return T.map_(T.forEachParN_(self, n, f), A.from) } /** * Applies the function f to each element of the Array and returns the results in a new B[] * * @ets_data_first mapEffectParN_ */ export function mapEffectParN(n: number, f: (a: A) => T.Effect) { return (self: A.Array) => mapEffectParN_(self, n, f) } /** * Applies the function f to each element of the Array and returns the results in a new B[] */ export function mapSync_( self: A.Array, f: (a: A) => S.Sync ): S.Sync> { return S.map_(S.forEach_(self, f), A.from) } /** * Applies the function f to each element of the Array and returns the results in a new B[] * * @ets_data_first mapSync_ */ export function mapSync(f: (a: A) => S.Sync) { return (self: A.Array): S.Sync> => mapSync_(self, f) }