effect-io-ai

Package: effect
Module: Array

Array.getRights

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

Example

import { Array, Either } from "effect"

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

Signature

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

Source

Since v2.0.0