Skip to content
Well-typed curry implementations
Branch: master
Clone or download
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.vscode
src feat(curry): first implementation Jan 7, 2017
.editorconfig
.gitignore
.npmignore
CHANGELOG.md
LICENSE Initial commit Jan 6, 2017
README.md
northbrook.ts feat(curry): first implementation Jan 7, 2017
package.json
tsconfig.json feat(curry): first implementation Jan 7, 2017
tslint.json
yarn.lock

README.md

@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
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.