-
Notifications
You must be signed in to change notification settings - Fork 0
Home
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.
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.
- Dict functions (functions that treat Objects like immutable Dictionaries)
- Helper functions
- Iterable functions
- Function functions (functions that transform functions)
- Math functions
- Number functions
- Object functions
- Predicate functions
- String functions
- Type functions
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