effect-io-ai

Package: effect
Module: Array

Array.getSomes

Retrieves the Some values from an Iterable of Options, collecting them into an array.

Example

import { Array, Option } from "effect"

const result = Array.getSomes([Option.some(1), Option.none(), Option.some(2)])
console.log(result) // [1, 2]

Signature

declare const getSomes: <T extends Iterable<Option.Option<X>>, X = any>(self: T) => Array<Option.Option.Value<ReadonlyArray.Infer<T>>>

Source

Since v2.0.0