@typed/curry
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

@typed/curry

A typescript version of curry for functional programming

Let me have it

npm install --save @typed/curry
# or
yarn add @typed/curry

One caveat is that it only accepts functions of arity 5 or less, as I believe functions with more than 3, and especially 5, parameters to be an anti-pattern.

Basic usage

import { curry } from '@typed/curry';

const add = curry((a: number, b: number) => a + b);

const add1 = add(1);
const add2 = add(2);

console.log(add1(5)) // 6
console.log(add2(5)) // 7

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.1
    668
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.1
    668
  • 1.0.0
    0

Package Sidebar

Install

npm i @typed/curry

Weekly Downloads

668

Version

1.0.1

License

MIT

Last publish

Collaborators

  • typed