effect-io-ai

Package: effect
Module: Function

Function.tupled

Creates a version of this function: instead of n arguments, it accepts a single tuple argument.

Example

import * as assert from "node:assert"
import { tupled } from "effect/Function"

const sumTupled = tupled((x: number, y: number): number => x + y)

assert.deepStrictEqual(sumTupled([1, 2]), 3)

Signature

declare const tupled: <A extends ReadonlyArray<unknown>, B>(f: (...a: A) => B) => (a: A) => B

Source

Since v2.0.0