Skip to main content
Module

x/fun/fn.ts>unary

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

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