@tdreyno/figment
TypeScript icon, indicating that this package has built-in type declarations

1.10.0 • Public • Published

Figment

Test Coverage npm latest version

Figment is a collection of functional programming helpers. This is my personal collection of utilities and is not intended to be comprehensive.

The library is built in TypeScript and is manually curried to make the final parameter to functions (the data parameter) a separate callback to aid in composibility. For example, here is the signature of map from lodash:

type map = <T, U>(fn: (item: T) => U, items: T[]) => U[]
const increment = a => a + 1
const result = map(increment, [1, 2, 3])

And here is the signature this library uses:

type map = <T, U>(fn: (item: T) => U) => (items: T[]) => U[]
const increment = a => a + 1
const incrementList = map(increment)
const result = incrementList([1, 2, 3])

Installation

Yarn

yarn add @tdreyno/figment

NPM

npm install --save @tdreyno/figment

Prior Art

fp-ts is a popular TypeScript library which implements functional concepts.

License

Figment is licensed under the Hippocratic License. It is an Ethical Source license derived from the MIT License, amended to limit the impact of the unethical use of open source software.

Dependencies (0)

    Dev Dependencies (28)

    Package Sidebar

    Install

    npm i @tdreyno/figment

    Weekly Downloads

    12

    Version

    1.10.0

    License

    none

    Unpacked Size

    176 kB

    Total Files

    130

    Last publish

    Collaborators

    • tdreyno91