Skip to main content
Module

x/curry/partial.ts>papplyRest

Currying and partial application utilities
Latest
function papplyRest
import { papplyRest } from "https://deno.land/x/curry@1.1.0/partial.ts";

Create a bound function with fixed arguments except the first one.

Examples

Example 1

import { papplyRest } from "https://deno.land/x/curry@$VERSION/mod.ts";

declare const fn: (a: string, b: number, c: boolean) => void;

const binary = papplyRest(fn, 0);
const unary = papplyRest(fn, 0, false);

Type Parameters

H
T extends readonly unknown[]
U extends readonly unknown[]
R

Parameters

fn: (...args: readonly [H, ...T, ...U]) => R
...tail: T

Returns

(head: H, ...rest: U) => R