really-typed-compose
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

Really typed compose

Performs right-to-left function composition. Supports types definitions.

((y → z), (x → y), …, (o → p), ((a, b, …, n) → o)) → ((a, b, …, n) → z)

Usage

npm i -S really-typed-compose

import { compose } from 'really-typed-compose'
 
const add = (b: number) => (a: number) => a + b;
const multiply = (b: number) => (a: number) => a * b;
 
const calc = compose(multiply(2), add(2));
 
calc(0) // 4
calc(1) // 6

Licence MIT

Package Sidebar

Install

npm i really-typed-compose

Weekly Downloads

0

Version

1.0.1

License

MIT

Unpacked Size

4.79 kB

Total Files

5

Last publish

Collaborators

  • awinogradov