effect-io-ai

Package: effect
Module: Array

Array.getLefts

Retrieves the Left values from an Iterable of Eithers, collecting them into an array.

Example

import { Array, Either } from "effect"

const result = Array.getLefts([Either.right(1), Either.left("err"), Either.right(2)])
console.log(result) // ["err"]

Signature

declare const getLefts: <T extends Iterable<Either.Either<any, any>>>(self: T) => Array<Either.Either.Left<ReadonlyArray.Infer<T>>>

Source

Since v2.0.0