module folktale

Folktale is a standard library for functional programming in JavaScript.

Documentation

Folktale is a standard library for functional programming in JavaScript.

Properties

Basic functional programming

core

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.

Concurrency

concurrency

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.

Experimental

Converting data

conversions

Allows converting between the different data structures provided by Folktale and JavaScript.

Fantasy Land

fantasyLand

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.

Handling failures

maybe

A data structure that models the presence or absence of a value.

result

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.

validation

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).

Modelling data

adt

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.

Experimental

Source Code

Defined in source/index.js at line 14, column 0
{
  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')
}
Stability
stable
Licence
MIT
Module
folktale
Authors
Copyright
(c) 2013-2017 Quildreen Motta, and CONTRIBUTORS
Authors
  • Quildreen Motta
Maintainers
  • Quildreen Motta <queen@robotlolita.me> (http://robotlolita.me/)