All Projects → TylorS → typed-curry

TylorS / typed-curry

Licence: MIT license
Well-typed curry implementations

Programming Languages

typescript
32286 projects

@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
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].