Package detail

@typed/curry

TylorS4.1kMIT1.0.1

Well-typed curry functions for TypeScript

typescript, curry, functional

readme

@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

changelog

1.0.1 (2017-01-06)


Bug Fixes

  • fix(package): add es2015 module and typings fields 921c1bf4

1.0.0 (2017-01-06)


Breaking Changes

  1. initial implementation
    • feat(curry): first implementation 94b51969