0.10.0 • Published 8 months ago

@neotype/prelude v0.10.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

neotype_prelude

Functional programming essentials for TypeScript

Build and Test NPM Version

Quick links

Features

  • Tools for comparing values: use the contracts provided by the Eq and Ord interfaces to implement equivalence relations and total orders.
  • Tools for combining values: use the contract provided by the Semigroup interface to implement semigroups.
  • Algebraic data types:
    • Model optional values with Maybe.
    • Handle failures with Either.
    • Validate forms and user input with Validation.
    • Get creative with more types like Ior and Pair.
  • Generator comprehensions: chain computations together by writing imperative style code blocks using a coroutine syntax.
  • Async generator comprehensions: work with Promise values inside of generator comprehensions using async/await syntax.

Install

neotype_prelude is available on NPM.

npm install @neotype/prelude

Working with modules

This library provides a suite of ES6 modules. A .js suffix is required in all import statements. All modules provide named exports.

import { cmb, Semigroup } from "@neotype/prelude/cmb.js";
import { cmp, eq, Eq, Ord } from "@neotype/prelude/cmp.js";
import { Either } from "@neotype/prelude/either.js";
import { Maybe } from "@neotype/prelude/maybe.js";
// etc.

See each module's documentation for recommended import practices and available exports.

Inspiration

This library takes inspiration from many existing functional programming languages and libraries, including:

0.10.0

8 months ago

0.9.0

1 year ago

0.8.1

1 year ago

0.8.0

1 year ago

0.7.0

1 year ago

0.6.0

1 year ago

0.3.0

2 years ago

0.2.1

2 years ago

0.2.0

2 years ago

0.5.0

2 years ago

0.4.0

2 years ago

0.1.0

2 years ago