// ets_tracing: off import * as A from "@effect-ts/core/Collections/Immutable/Array" import * as E from "@effect-ts/core/Either" import * as O from "@effect-ts/core/Option" export function mapEither_( self: A.Array, f: (a: A) => E.Either ): E.Either> { const res = [] as B[] for (const a of self) { const x = f(a) if (E.isLeft(x)) { return x } res.push(x.right) } return E.right(res) } export function mapOption_( self: A.Array, f: (a: A) => O.Option ): O.Option> { const res = [] as B[] for (const a of self) { const x = f(a) if (O.isNone(x)) { return x } res.push(x.value) } return O.some(res) }