Hyperlinkv0.9.0-beta.0

Tuple

Tuple.makeconsteffect/Tuple.ts:47
<Elements extends ReadonlyArray<unknown>>(...elements: Elements): Elements

Creates a tuple from the provided arguments.

When to use

Use when you need a properly typed tuple without writing [a, b, c] as const or another manual cast.

Details

The returned value has the exact tuple type, with each element's literal type preserved.

Example (Creating a tuple)

import { Tuple } from "effect"

const point = Tuple.make(10, 20, "red")
console.log(point) // [10, 20, "red"]
constructorsgetappendElement
Source effect/Tuple.ts:471 lines
export const make = <Elements extends ReadonlyArray<unknown>>(...elements: Elements): Elements => elements
Referenced by 2 symbols