Skip to content
Jason Barr edited this page Sep 26, 2021 · 42 revisions

Fluent Functional Programming in JavaScript

This library is a collection of functional data types that use a fluent object-oriented interface so you can chain methods to your heart's content and still take advantage of better null checking with Option, better error handling with Result, and more. There is also a growing collection of utility functions and functional helpers like pipeline, compose, and curry to help make your JavaScript more functional.

I like to think of it as a functional programming library that also takes seriously the object-oriented features of JavaScript. I think it's an error to say functional programming and OOP are incompatible; it's just about using the best tools for a particular task. Hopefully this library will give you some useful tools.

Types

  • All
  • Any
  • Assign
  • Effect
  • Endo
  • First
  • Last
  • Max
  • Min
  • Pair
  • Product
  • Range
  • Sum

Collections

Functions

The goal is to eventually replicate all native JavaScript object methods with a functional (and curried) interface. There are also many other useful functions here.

Usage

Currently, installing the library requires cloning this repo. Eventually I will publish it as an NPM package, but we're not there yet.

All functions and types are individually exported, so import directly from the source, e.g.

import { Option } from "src/types/Option";
import { bigint } from "src/functions/numbers/bigint";
// and so on
Clone this wiki locally