Folktale is a suite of libraries for generic functional programming in JavaScript. It allows the construction of elegant, and robust programs, with highly reusable abstractions to keep the code base maintainable.
The library is organised by a variety of modules split into logical categories,
with the conventional naming of <Category>.<Module>
. This page provides
reference documentation for all the modules in the Folktale library, including
usage examples and cross-references for helping you find related concepts that
might map better to a particular problem.
Provides the most basic and essential building blocks and compositional operations, which are likely to be used by most programs.
Restricts the arity of variadic functions.
Run-time interface checking/contracts for JavaScript values.
Human-readable representations of built-in and custom objects.
Essential functional combinators and higher-order functions derived from λ-Calculus.
Curried and first-class versions of JavaScript built-in operators.
Provides operations for control-flow.
Common monadic combinators and sequencing operations.
Common operations for asynchronous control-flow with Data.Task.
Provides functional (persistent and immutable) data structures for representing program data.
Right-biased disjunctions. Commonly used for modelling computations that may fail with additional information about the failure.
Safe optional values. Commonly used for modelling computations that may fail, or values that might not be available.
A structure for capturing the effects of time-dependent values (asynchronous computations, latency, etc.) with automatic resource management.
A disjunction for validating inputs and aggregating failures. Isomorphic to Data.Either.