Skip to main content
Module

x/fun/mod.ts>fn.unary

A collection of algebraic data types, lenses, and schemables based on a light weight higher kinded type implementation. Written for deno.
Latest
function fn.unary
import { fn } from "https://deno.land/x/fun@v2.0.0/mod.ts";
const { unary } = fn;

Take a variadic Fn and make it unary, collapsing multiple arguments into a single tuple argument.

Examples

Example 1

import * as F from "./fn.ts";

const person = (age: number, name: string) => ({ age, name });
const personUnary = F.unary(person);

// ({ name: "Brandon", age: 37 })
const result1 = personUnary([37, "Brandon"]);

Type Parameters

D extends unknown[]
A

Parameters

fda: (...d: D) => A