Package: effect
Module: Tuple
Retrieves the element at the specified index from a tuple.
When to use
Use when a single tuple element should be extracted in a pipeline.
Details
The index is constrained to valid tuple positions at the type level.
Example (Extracting an element by index)
import { pipe, Tuple } from "effect"
const last = pipe(Tuple.make(1, true, "hello"), Tuple.get(2))
console.log(last) // "hello"
See
make – create a tuplepick – extract multiple elements into a new tupleSignature
declare const get: { <const T extends ReadonlyArray<unknown>, I extends Indices<T> & keyof T>(index: I): (self: T) => T[I]; <const T extends ReadonlyArray<unknown>, I extends Indices<T> & keyof T>(self: T, index: I): T[I]; }
Since v4.0.0