effect-io-ai

Package: effect
Module: Tuple

Tuple.at

Retrieves the element at a specified index from a tuple.

Example

import * as assert from "node:assert"
import { Tuple } from "effect"

assert.deepStrictEqual(Tuple.at([1, 'hello', true], 1), 'hello')

Signature

declare const at: { <N extends number>(index: N): <A extends ReadonlyArray<unknown>>(self: A) => A[N]; <A extends ReadonlyArray<unknown>, N extends number>(self: A, index: N): A[N]; }

Source

Since v3.4.0