Folktale is a standard library for functional programming in JavaScript.
Folktale is a standard library for functional programming in JavaScript.
Utilities for handling native JavaScript objects in a more functional way. Lambda
adds functions to combine functions and simplify abstractions (such as currying and partial application). Object
provides functions to handle JS objects as functional dictionaries.
Provides tools for managing asynchronous concurrent operations in JavaScript. Task
models asynchronous operations with automatic resource management, whereas Future
is a simpler alternative to Promise
.
Allows converting between the different data structures provided by Folktale and JavaScript.
Allows invoking methods of Fantasy Land structures without worrying about the differences in multiple versions of the spec implemented by different libraries. You may want to use this instead of calling the methods directly if you're writing generic functions to work with any fantasy-land library.
A data structure that models the presence or absence of a value.
A data structure that models the result of operations that may fail. A Result
helps with representing errors and propagating them, giving users a more
controllable form of sequencing operations than that offered by constructs like
try/catch
.
A data structure that typically models form validations, and other scenarios where
you want to aggregate all failures, rather than short-circuit if an error
happens (for which Result
is better suited).
Provides tools to model data structures in a functional way. The union
module allows simple definitions of tagged unions to model one-of-many possibilities.
{
adt: require('./adt'),
concurrency: require('./concurrency'),
conversions: require('./conversions'),
core: require('./core'),
fantasyLand: require('./fantasy-land'),
maybe: require('./maybe'),
result: require('./result'),
validation: require('./validation')
}