754 lines
40 KiB
HTML
754 lines
40 KiB
HTML
<h1 id="awesome-fp-js-awesome">Awesome FP JS <a
|
||
href="https://github.com/sindresorhus/awesome"><img
|
||
src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg"
|
||
alt="Awesome" /></a></h1>
|
||
<p>This is a curated list of awesome <a
|
||
href="https://en.wikipedia.org/wiki/Functional_programming">functional
|
||
programming</a> code and learning resources for JavaScript. As a
|
||
multi-paradigm programming language, JavaScript can be written in many
|
||
styles. With these resources we want to help you to make better use of
|
||
JavaScript’s support for writing programs in a <em>functional</em>
|
||
way.</p>
|
||
<p>Functional programming is a <a
|
||
href="https://wiki.haskell.org/Functional_programming">style of
|
||
programming</a> which models computations as the evaluation of
|
||
expressions. Contrast this with imperative programming where programs
|
||
are composed of statements which change global state when executed.
|
||
Functional programming typically avoids using mutable state and favors
|
||
<em>side-effect free</em> functions and <em>immutable</em> data instead.
|
||
This encourages writing composable and declarative programs that are
|
||
easy to reason about.</p>
|
||
<h5 id="table-of-contents">Table of Contents</h5>
|
||
<ul>
|
||
<li><a href="#libraries">Libraries</a>
|
||
<ul>
|
||
<li><a href="#data-structures">Data Structures</a></li>
|
||
<li><a href="#algebraic-data-types">Algebraic Data Types</a></li>
|
||
<li><a href="#lenses">Lenses</a></li>
|
||
</ul></li>
|
||
<li><a
|
||
href="#functional-languages-that-compile-to-javascript">Functional
|
||
Languages that Compile to JavaScript</a></li>
|
||
<li><a href="#programming-tools">Programming Tools</a></li>
|
||
<li><a href="#resources">Resources</a>
|
||
<ul>
|
||
<li><a href="#books">Books</a></li>
|
||
<li><a href="#articles">Articles</a></li>
|
||
<li><a href="#videos">Videos</a></li>
|
||
<li><a href="#examples-and-exercises">Examples and Exercises</a></li>
|
||
</ul></li>
|
||
<li><a href="#community">Community</a></li>
|
||
<li><a href="#contribution">Contribution</a></li>
|
||
</ul>
|
||
<h5 id="tags">Tags</h5>
|
||
<p>These may be appended to entries. Each should be preceded by a “+” or
|
||
“-” to indicate presence or absence of the tag’s meaning. “-” tags
|
||
should only be included when they are likely to help someone filter
|
||
libraries for their needs. For instance, <code>-TS</code> tags are
|
||
probably useful for Typescript users screening for types, but
|
||
<code>-CT</code> tags would be less likely to be helpful to anyone.</p>
|
||
<ul>
|
||
<li><strong>CT</strong>. Category Theory. This library appears to be
|
||
inspired by Haskell, Scala, or another functional language’s library
|
||
with a grounding in Category Theory.</li>
|
||
<li><strong>TS</strong>. Typescript. This library has typescript
|
||
types.</li>
|
||
</ul>
|
||
<h2 id="libraries">Libraries</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/ramda/ramda">Ramda</a> – A practical
|
||
functional library for JavaScript that is designed specifically for a
|
||
functional programming style. A style that makes it easy to create
|
||
functional pipelines and never mutates user data. +TS.</li>
|
||
<li><a href="https://github.com/char0n/ramda-adjunct">Ramda Adjunct</a>
|
||
is a community-maintained extension of Ramda.</li>
|
||
<li><a
|
||
href="https://github.com/tommmyy/ramda-extension">Ramda-extension</a> is
|
||
set of utility point-free functions composed only from Ramda
|
||
functions.</li>
|
||
<li><a href="https://github.com/selfrefactor/rambda">Rambda</a> - A
|
||
faster alternative to Ramda in under 10kB.</li>
|
||
<li><a href="https://github.com/selfrefactor/rambdax">Rambdax</a> -
|
||
Extended version of Rambda</li>
|
||
<li><a href="http://folktale.origamitower.com/">Folktale</a> – A
|
||
standard library for functional programming in JavaScript. Typescript
|
||
support expected mid-2020. -TS.</li>
|
||
<li><a
|
||
href="https://github.com/lodash/lodash/wiki/FP-Guide">lodash/fp</a> – An
|
||
instance of <a href="https://github.com/lodash/lodash">Lodash</a> with
|
||
its methods wrapped to produce immutable, auto-curried, iteratee-first,
|
||
data-last methods. +TS.</li>
|
||
<li><a
|
||
href="https://github.com/functionaljs/functional-js">functional.js</a> –
|
||
A lightweight functional JavaScript library that facilitates currying
|
||
and point-free / tacit programming.</li>
|
||
<li><a href="https://github.com/tjmehta/101">101</a> – A modern and
|
||
modular JavaScript utility library made to work well with vanilla
|
||
JavaScript methods. -TS</li>
|
||
<li><a href="https://github.com/algesten/fnuc">fnuc</a> – A functional
|
||
library for CoffeeScript (and JavaScript) to facilitate functional
|
||
composition and higher order functions.</li>
|
||
<li><a
|
||
href="https://github.com/cullophid/barely-functional">barely-functional</a>
|
||
– A tiny (2.7kb) functional programming library using native ES5/6
|
||
operations. -TS.</li>
|
||
<li><a
|
||
href="https://github.com/zhangchiqing/bluebird-promisell">bluebird-promisell</a>
|
||
- A practical functional programming library for promises.</li>
|
||
<li><a href="http://gkz.github.io/prelude-ls/">prelude.ls</a> – A
|
||
functionally oriented utility library somewhat based off of Haskell’s
|
||
Prelude module. -TS.</li>
|
||
<li><a href="https://github.com/alanrsoares/prelude-js">preludejs</a> -
|
||
Hardcore Functional Programming for JavaScript. -TS.</li>
|
||
<li><a href="https://github.com/1-liners/1-liners">1-liners</a> –
|
||
Functional tools that couldn’t be simpler. A dead simple functional
|
||
utility belt, hand-crafted with love and attention. -TS.</li>
|
||
<li><a href="https://github.com/thunklife/fn-curry">fn-curry</a> – A
|
||
simple function to curry a function.</li>
|
||
<li><a href="https://github.com/thisables/curry">curry</a> – Curry your
|
||
functions using function bind syntax.</li>
|
||
<li><a
|
||
href="https://github.com/stoeffel/compose-function">compose-function</a>
|
||
– Compose a new function from smaller functions.</li>
|
||
<li><a href="https://github.com/paldepind/functionize">functionize</a> –
|
||
A collection of functions which aid in making non-functional libraries
|
||
functional.</li>
|
||
<li><a href="https://github.com/loop-recur/lambdajs">lambdajs</a> – The
|
||
full ECMAScript API done a functional way.</li>
|
||
<li><a href="https://github.com/fp-dom/">fp-dom</a> – Making the DOM
|
||
functional.</li>
|
||
<li><a
|
||
href="https://github.com/sultan99/react-on-lambda">react-on-lambda</a> -
|
||
Replace JSX in React with functions (currying, compositions and
|
||
etc).</li>
|
||
<li><a href="https://github.com/algesten/trifl">trifl</a> – A functional
|
||
user interface library with unidirectional dataflow and a virtual
|
||
dom.</li>
|
||
<li><a href="https://github.com/bramstein/funcy">funcy</a> – An
|
||
experiment in adding functional pattern matching to JavaScript.
|
||
<em>Experimental</em> :triangular_flag_on_post:</li>
|
||
<li><a href="https://github.com/cullophid/date-fp">date-fp</a> – A
|
||
functional utility library for working with JavaScript dates. All
|
||
functions in date-fp are pure, autocurried and will not mutate the date
|
||
objects they are applied to.</li>
|
||
<li><a href="https://github.com/js-joda/js-joda">js-joda</a> – An
|
||
immutable date and time library that provides a simple, domain-driven
|
||
and clean API based on the ISO8601 calendar.</li>
|
||
<li><a href="https://github.com/AutoSponge/_part_">_part_</a> – A micro
|
||
library that encourages functional programming by making native methods
|
||
available as partially applied functions.</li>
|
||
<li><a href="https://github.com/robotlolita/claire">claire</a> – A
|
||
property-based testing library for clearly specifying code invariants
|
||
and behaviour.</li>
|
||
<li><a href="https://github.com/getify/fpo">FPO.js</a> – FP library for
|
||
JavaScript by Kyle Simpson (aka getify). Supports named-argument style
|
||
methods.</li>
|
||
<li><a href="https://github.com/d-plaindoux/parsec">Javascript Parser
|
||
Combinator</a> – Javascript parser combinator implementation inspired by
|
||
the Haskell’s Parsec</li>
|
||
<li><a href="https://github.com/rpominov/fun-task">fun-task</a> – An
|
||
abstraction for managing asynchronous code in JS. Tasks are similar to
|
||
Promises with the key difference that Tasks can represent a computation
|
||
while Promises can represent only the results of a computation. Ships
|
||
with Flow type definitions.</li>
|
||
<li><a href="https://github.com/cujojs/most">most</a> – Ultra-high
|
||
performance reactive programming to help you compose asynchronous
|
||
operations on streams of values and events without many of the hazards
|
||
of side effects and mutable shared state.</li>
|
||
<li><a href="https://github.com/joaomilho/zen-signals">zen-signals</a> –
|
||
☯ The simplest signal library possible</li>
|
||
<li><a href="https://github.com/funfix/funfix">funfix</a> – Funfix is a
|
||
library of type classes and data types for Functional Programming in
|
||
JavaScript, TypeScript and Flow. +CT, +TS.</li>
|
||
<li><a href="https://github.com/trainyard/pico-lambda">pico-lambda</a> -
|
||
Arrays, Strings and things the functional way. A 640b functional library
|
||
based on native methods. -TS.</li>
|
||
<li><a
|
||
href="https://github.com/concretesolutions/pareto.js/">pareto-js</a> -
|
||
An extremely small, intuitive and fast functional utility library for
|
||
JavaScript -TS.</li>
|
||
<li><a href="https://github.com/TeaEntityLab/fpEs/">fpEs</a> - A small
|
||
library provides simple usages of basic FP &
|
||
pattern-matching/sumtype & MonadIO/Rx & Optional for Javascript.
|
||
-TS.</li>
|
||
<li><a href="http://blog.briancavalier.com/creed/">Creed</a> –
|
||
Sophisticated and functionally-minded async with advanced features:
|
||
coroutines, promises, ES2015 iterables, fantasy-land. -TS.</li>
|
||
<li><a href="https://github.com/samchon/tgrid">TGrid</a> - Grid
|
||
Computing Framework, Network & Thread extension of <a
|
||
href="https://github.com/samchon/tstl">TSTL</a>, supporting RFC (Remote
|
||
Function Call). +TS.</li>
|
||
<li><a href="https://github.com/adobe/ferrum">Ferrum</a> – Iterator
|
||
library with support for objects as iterables, lazy evaulation
|
||
and<code>pipe()</code>; implements Traits (from Rust)/Type Classes (from
|
||
Haskell) in JS. -TS.</li>
|
||
<li><a href="https://gcanti.github.io/fp-ts/">fp-ts</a> - Typed
|
||
functional programming in TypeScript. +CT, +TS.</li>
|
||
<li><a href="https://github.com/iter-tools/iter-tools">iter-tools</a> -
|
||
a rich toolset for working with iterables, both sync and async.
|
||
+TS.</li>
|
||
<li><a href="https://remedajs.com/">remeda</a> A function library
|
||
roughly subsetting Ramda, but written in Typescript and thus more
|
||
type-friendly. +TS.</li>
|
||
<li><a href="https://github.com/smartprocure/futil-js">futil-js</a> - A
|
||
collection of functional utilities that could conceivably be part of a
|
||
library like lodash/fp, but for some reason or other are not.</li>
|
||
<li><a href="https://github.com/a-synchronous/rubico">rubico</a> - 🏞
|
||
[a]synchronous functional syntax</li>
|
||
<li><a href="https://github.com/darky/rocket-pipes">rocket-pipes</a> -
|
||
Powerful pipes, that chain Promise and ADT like Maybe or Either from
|
||
popular FP libraries. +TS</li>
|
||
<li><a href="https://github.com/Debdut/omg-curry">omg-curry</a> -
|
||
Comprehensive Curry Library with Operator Curry, Curry from functions,
|
||
Decurry and Infifnite Curries.</li>
|
||
<li><a href="https://github.com/TomerAberbach/lfi">lfi</a> - A Lazy
|
||
Functional Iteration Library Supporting Sync, Async, and Concurrent
|
||
Iteration.</li>
|
||
<li><a href="https://github.com/darky/ts-multimethod">ts-multimethod</a>
|
||
- TypeScript multimethods inspired by Clojure multimethods. +TS</li>
|
||
<li><a href="https://github.com/darky/ts-fp-di">ts-fp-di</a> - Tiny
|
||
TypeScript functional dependency injection, based on Node.js
|
||
AsyncLocalStorage. +TS</li>
|
||
<li><a href="https://github.com/Effect-TS/core">effect-ts</a> – A
|
||
Fully-fledged functional effect system for typescript with a rich
|
||
standard library. +TS</li>
|
||
<li><a href="https://github.com/tusharmath/qio">qio</a> – A type-safe,
|
||
functional, performant, lawful, composable data structure that solves
|
||
practical problems of effect-full code in node and browser. +TS</li>
|
||
<li><a href="https://github.com/mnasyrov/ditox">Ditox.js</a> - Powerful
|
||
dependency injection container for building modular apps. +TS</li>
|
||
<li><a href="https://github.com/mnasyrov/rx-effects">RxEffects</a> -
|
||
Reactive state and effect management with RxJS. +TS</li>
|
||
<li><a href="https://github.com/marpple/FxTS">fxts</a> - Lazy evaluation
|
||
and concurrency. +TS</li>
|
||
<li><a href="https://mobily.github.io/ts-belt/">ts-belt</a> - Fast,
|
||
modern, and practical utility library for FP in TypeScript. (Uses a
|
||
data-first approach like remeda, but is <a
|
||
href="https://mobily.github.io/ts-belt/benchmarks/v3.7.0/macbook-air-2020">faster</a>
|
||
than remeda, ramda, rambda, and lodash/fp.)</li>
|
||
<li><a href="https://github.com/lulldev/fp-multik">fp-multik</a> - JS/TS
|
||
lightweight value-multimethod util</li>
|
||
<li><a href="https://github.com/true-myth/true-myth">true-myth</a> A
|
||
library for safe, idiomatic null and error handling in TypeScript, with
|
||
<code>Maybe</code> and <code>Result</code> types, supporting both a
|
||
functional style and a more traditional method-call style</li>
|
||
<li><a href="https://github.com/gvergnaud/ts-pattern">ts-pattern</a> -
|
||
The exhaustive Pattern Matching library for TypeScript, with smart type
|
||
inference. Pattern Matching is a code-branching technique coming from FP
|
||
languages.</li>
|
||
<li><a href="https://github.com/ENvironmentSet/hyogwa">hyogwa</a> -
|
||
Natural 🌿 effect system that fits TypeScript; Write codes as you write
|
||
<strong>plain typescript code</strong>.</li>
|
||
<li><a
|
||
href="https://github.com/laurentpayot/verticalize">Verticalize</a> -
|
||
Super lightweight function that looks and behaves like a pipe
|
||
operator.</li>
|
||
<li><a href="https://github.com/PureEval/PureEval">PureEval</a> - A
|
||
powerful JavaScript functional programming toolset, including utility
|
||
functions and abstract data structures.</li>
|
||
<li><a href="https://github.com/darky/context-fp">context-fp</a> -
|
||
Microscopic functional programming context aka dependency injection.
|
||
+TS</li>
|
||
</ul>
|
||
<h3 id="data-structures">Data Structures</h3>
|
||
<p>Write performant functional code by using the right data structures
|
||
for the task.</p>
|
||
<ul>
|
||
<li><a href="https://github.com/aearly/icepick">Icepick</a> Utilities
|
||
for treating frozen JavaScript objects as persistent immutable
|
||
collections</li>
|
||
<li><a href="https://github.com/facebook/immutable-js">Immutable.js</a>
|
||
– Immutable persistent data collections.</li>
|
||
<li><a href="https://github.com/mweststrate/immer">Immer</a> – Immer is
|
||
a tiny package for immutable state based on copy-on-write mechanism.
|
||
+TS.</li>
|
||
<li><a href="https://github.com/swannodette/mori">Mori</a> –
|
||
ClojureScript’s persistent data structures and supporting API from the
|
||
comfort of vanilla JavaScript.</li>
|
||
<li><a href="https://github.com/Yomguithereal/baobab">Baobab</a> –
|
||
persistent and optionally immutable data tree with cursors.</li>
|
||
<li><a
|
||
href="https://github.com/qiao/immutable-sequence.js">immutable-sequence.js</a>
|
||
– High performance implementation of Immutable Sequence in JavaScript,
|
||
based on <a href="https://github.com/qiao/fingertree.js">Finger
|
||
Trees</a>.</li>
|
||
<li><a href="http://guigrpa.github.io/timm/">Timm</a> – Immutability
|
||
helpers with fast reads and acceptable writes.</li>
|
||
<li><a href="https://github.com/dtao/lazy.js">Lazy.js</a> – A utility
|
||
library with a lazy engine under the hood that strives to do as little
|
||
work as possible while being as flexible as possible.</li>
|
||
<li><a href="https://github.com/ds300/derivablejs">DerivableJS</a> –
|
||
Functional Reactive State for JavaScript and TypeScript. DerivableJS
|
||
enables you to make elegant declarative statements about how your bits
|
||
of state are related. +TS.</li>
|
||
<li><a href="https://github.com/benji6/imlazy">imlazy</a> – Library for
|
||
creating and manipulating lazy iterables using the ES2015 iteration
|
||
protocols.</li>
|
||
<li><a href="https://github.com/frptools/collectable">collectable</a> –
|
||
Super high-performance immutable data structures for modern JavaScript
|
||
and TypeScript applications. +TS.</li>
|
||
<li><a href="https://github.com/funkia/list">List</a> - An extremely
|
||
fast immutable list with a comprehensive functional API. Designed to <a
|
||
href="https://github.com/funkia/list#seamless-ramda-integration">seamlessly
|
||
integrate with Ramda</a>.</li>
|
||
<li><a
|
||
href="https://github.com/emmanueltouzery/prelude.ts">prelude.ts</a> -
|
||
Immutable persistent collections, functional constructs such as Option
|
||
and Either, and combinators. Implemented in Typescript but supports
|
||
javascript too. +CT, +TS.</li>
|
||
<li><a href="https://github.com/samchon/tstl">TSTL</a> - C++ STL
|
||
(Standard Template Library) is implemented in TypeScript. STL
|
||
Containers, iterators, algorithms and functors, that following
|
||
functional programming rule, are provided. +TS.</li>
|
||
</ul>
|
||
<h3 id="algebraic-data-types">Algebraic Data Types</h3>
|
||
<p>Use the laws of math instead of always reinventing your own thing.
|
||
Algebraic!</p>
|
||
<ul>
|
||
<li><a href="https://github.com/fantasyland/fantasy-land">Fantasy
|
||
Land</a> – Not a library, but a specification of the Monad laws for
|
||
libraries to follow.</li>
|
||
<li><a href="https://github.com/rpominov/static-land">Static Land</a> –
|
||
Specification similar to Fantasy Land but based on static methods rather
|
||
than instance methods.</li>
|
||
<li><a
|
||
href="https://github.com/DrBoolean/immutable-ext">immutable-ext</a> –
|
||
FantasyLand extensions for <a
|
||
href="https://github.com/facebook/immutable-js">Immutable.js</a>.</li>
|
||
<li><a href="https://github.com/puffnfresh/daggy">daggy</a> – Library
|
||
for creating tagged constructors.</li>
|
||
<li><a href="https://github.com/plaid/sanctuary">Sanctuary</a> –
|
||
Sanctuary makes it possible to write safe code without null checks. +CT,
|
||
+TS.</li>
|
||
<li><a href="http://cwmyers.github.io/monet.js/">monet.js</a> – A
|
||
library that assists functional programming by providing a rich set of
|
||
Monads and other useful functions. +CT, +TS.</li>
|
||
<li><a href="https://github.com/paldepind/union-type">union-type</a> – A
|
||
small JavaScript library for defining and using union types.</li>
|
||
<li><a href="https://github.com/DrBoolean/freeky">freeky</a> – A
|
||
collection of Free monads.</li>
|
||
<li><a href="https://github.com/Avaq/Fluture">Fluture</a> – A Future
|
||
library with included control utilities, high performance and great
|
||
error messages.</li>
|
||
<li><a
|
||
href="https://github.com/fantasyland/fantasy-combinators">fantasy-combinators</a>
|
||
– Common combinators.</li>
|
||
<li><a
|
||
href="https://github.com/fantasyland/fantasy-birds">fantasy-birds</a> –
|
||
Port of the Haskell package Data.Aviary.Birds. Everything for your
|
||
combinatory needs.</li>
|
||
<li><a href="https://github.com/evilsoft/crocks">crocks</a> – A
|
||
collection of popular Algebraic Data Types with the main goal to curate
|
||
and provide not only a common interface between each type, but also all
|
||
of the helper functions needed to hit the ground running. -TS.</li>
|
||
<li><a href="https://github.com/blitzritz/kudojs">kudo-js</a> - A small
|
||
utility library with a set of Algebraic Data Types and Helper functions
|
||
to help you write code in a functional programming style in
|
||
Javascript</li>
|
||
<li><a href="https://github.com/gigobyte/purify">purify</a> - Functional
|
||
programming library for TypeScript focusing on ADTs. +CT, +TS.</li>
|
||
<li><a href="https://github.com/joelnet/MojiScript">MojiScript</a>- an
|
||
async-first, opinionated, and functional language designed to have 100%
|
||
compatibility with JavaScript engines</li>
|
||
<li><a href="https://github.com/rametta/pratica">Pratica</a> - Small,
|
||
simple, easy FP data types for pragmatic and productive developers who
|
||
need to ship reliable code fast. +CT, +TS.</li>
|
||
<li><a href="https://github.com/mobily/tifi">Tifi</a> - Tifi is a
|
||
library for functional programming in TypeScript. It solves a problem of
|
||
the existence of both <code>undefined</code> and <code>null</code>. Tifi
|
||
is inspired by the OCaml/Reason utilities for the option data type. +CT,
|
||
+TS.</li>
|
||
<li><a href="https://github.com/JSMonk/sweet-monads">sweet-monads</a> -
|
||
A collection of popular monads (such as <code>Either</code> and
|
||
<code>Maybe</code>) and the lazy iterator.</li>
|
||
</ul>
|
||
<h3 id="lenses">Lenses</h3>
|
||
<ul>
|
||
<li><a href="https://github.com/DrBoolean/lenses">lenses</a> –
|
||
Composable <a href="https://github.com/ekmett/lens">kmett</a> style
|
||
lenses.</li>
|
||
<li><a href="https://github.com/flunc/optics">optics</a> – Profunctor
|
||
optics (Lens, Prism, iso).</li>
|
||
<li><a href="https://github.com/ramda/ramda-lens">ramda-lens</a> – :ram:
|
||
:mag_right: Lens library built on Ramda.</li>
|
||
<li><a
|
||
href="https://github.com/fantasyland/fantasy-lenses">fantasy-lenses</a>
|
||
– Composable, immutable getters and setters. (Profunctor lenses
|
||
WIP)</li>
|
||
<li><a href="https://github.com/5outh/nanoscope">nanoscope</a> – Lenses
|
||
with dotty support.</li>
|
||
<li><a
|
||
href="https://github.com/calmm-js/partial.lenses">partial.lenses</a> –
|
||
Partial lenses is a comprehensive, high-performance optics library for
|
||
JavaScript.</li>
|
||
<li><a href="https://github.com/jamesmcnamara/shades">shades</a> – A
|
||
lodash-inspired lens-like library for Javascript.</li>
|
||
</ul>
|
||
<h2 id="functional-languages-that-compile-to-javascript">Functional
|
||
Languages that Compile to JavaScript</h2>
|
||
<ul>
|
||
<li><a href="https://github.com/clojure/clojurescript">ClojureScript</a>
|
||
– Compiles <a href="http://clojure.org/">Clojure</a>, a hosted Lisp with
|
||
immutable persistent data structures, to JavaScript.</li>
|
||
<li><a href="http://elm-lang.org/">Elm</a> – A type-safe functional
|
||
programming language for declaratively creating web browser-based
|
||
graphical user interfaces. Implemented in Haskell.</li>
|
||
<li><a href="http://fable.io/">Fable</a> - Compiles <a
|
||
href="http://fsharp.org">F#</a> to readable JavaScript.</li>
|
||
<li><a href="http://www.purescript.org/">PureScript</a> – A small
|
||
strongly typed programming language that compiles to JavaScript.</li>
|
||
<li><a href="http://www.idris-lang.org/">Idris</a> – A general purpose
|
||
pure functional programming language with dependent types.</li>
|
||
<li><a href="https://github.com/ghcjs/ghcjs">GHCJS</a> – <a
|
||
href="https://www.haskell.org/">Haskell</a> to JavaScript compiler,
|
||
based on GHC.</li>
|
||
<li><a href="https://github.com/bryanjos/elixirscript">ElixirScript</a>
|
||
– Compiles a subset of <a href="http://elixir-lang.org/">Elixir</a>, a
|
||
dynamic, functional language designed for building scalable and
|
||
maintainable applications, to JavaScript.</li>
|
||
<li><a href="http://ocsigen.org/js_of_ocaml/">Js_of_ocaml</a> – Compiles
|
||
<a href="http://ocaml.org/">OCaml</a> bytecode to JavaScript, making it
|
||
possible to run OCaml programs in the browser.</li>
|
||
<li><a href="https://reasonml.github.io">Reason</a> – Reason is a new
|
||
interface to OCaml, a highly expressive dialect of the ML language
|
||
featuring type inference and static type checking.</li>
|
||
<li><a href="https://rescript-lang.org/">ReScript</a> – (previously
|
||
known as <a
|
||
href="https://rescript-lang.org/bucklescript-rebranding">Bucklescript</a>)
|
||
ReScript is a type-safe language that compiles to the highest quality of
|
||
clean, readable and performant JavaScript code.</li>
|
||
<li><a href="http://www.scala-js.org/">Scala.js</a> – Compiles <a
|
||
href="http://www.scala-lang.org/">Scala</a> to JavaScript.</li>
|
||
<li><a href="http://gkz.github.io/LiveScript/">LiveScript</a> –
|
||
LiveScript has a straightforward mapping to JavaScript and allows you to
|
||
write expressive code devoid of repetitive boilerplate.</li>
|
||
<li><a href="https://github.com/quack/quack">Quack</a> - A
|
||
multi-paradigm programming language with gradual and duck typing that
|
||
targets PHP and JS.</li>
|
||
<li><a href="https://github.com/ion-lang/ion">ion</a> - no BS JS</li>
|
||
<li><a href="https://github.com/yosbelms/ramdascript">RamdaScript</a> -
|
||
A Lisp that compiles to opinionated JavaScript on top of RamdaJS</li>
|
||
<li><a href="https://github.com/vishesh/racketscript">RacketScript</a> –
|
||
RacketScript aims to leverage both JavaScript and Racket’s ecosystem,
|
||
and make interoperability between them clean and smooth.</li>
|
||
<li><a
|
||
href="https://www.microsoft.com/en-us/research/project/koka/">Koka</a> –
|
||
Koka is a function-oriented programming language that seperates pure
|
||
values from side-effecting computations with a familiar JavaScript like
|
||
syntax.</li>
|
||
<li><a href="https://www.typescriptlang.org/">TypeScript</a> -
|
||
TypeScript is a typed superset of JavaScript that compiles to plain
|
||
JavaScript.</li>
|
||
<li><a href="https://gleam.run">Gleam</a> - Gleam is a typed, functional
|
||
language that compiles to Erlang and JavaScript.</li>
|
||
</ul>
|
||
<h2 id="programming-tools">Programming Tools</h2>
|
||
<ul>
|
||
<li><a
|
||
href="https://github.com/jfmengels/eslint-plugin-fp">eslint-plugin-fp</a>
|
||
- ESLint rules for functional programming</li>
|
||
<li><a href="https://github.com/TylorS/4.5">4.5</a> – A functional
|
||
assertions library. If you prefer functional style APIs and practices in
|
||
JavaScript, this library aims to solve this with functionally-oriented
|
||
assertions that are lazy and monadic.</li>
|
||
<li><a href="https://github.com/xodio/hm-def">hm-def</a> – Runtime type
|
||
checking for JS with Hindley Milner signatures.</li>
|
||
<li><a href="https://github.com/kongware/ftor">ftor</a> - A pluggable
|
||
runtime type checker and functional debugging tool that supports
|
||
parametric and row polymorphism, implicit rank-2 types and algebraic
|
||
data types via Scott Encoding.</li>
|
||
</ul>
|
||
<h2 id="resources">Resources</h2>
|
||
<h3 id="books">Books</h3>
|
||
<ul>
|
||
<li><a
|
||
href="https://github.com/MostlyAdequate/mostly-adequate-guide">Professor
|
||
Frisby’s Mostly Adequate Guide to Functional Programming</a> – This is a
|
||
book on the functional paradigm in general using the world’s most
|
||
popular functional programming language: JavaScript. It’s a practical
|
||
introduction that builds up intuition through real-world examples.
|
||
Strongly recommended. By <a href="https://twitter.com/drboolean">Brian
|
||
Lonsdorf</a> (2016)</li>
|
||
<li><a
|
||
href="https://github.com/getify/functional-light-js">Functional-Light
|
||
JavaScript</a> – This book explores the core principles of functional
|
||
programming (FP) that can be applied to JavaScript. But what makes this
|
||
book different is that it approaches these principles without all the
|
||
heavy terminology.</li>
|
||
<li><a href="https://leanpub.com/javascriptallongesix">JavaScript
|
||
Allongé</a>, the “Six” edition. Starts with as little as possible about
|
||
functions – but no less! – and builds up towards powerful combinators
|
||
and decorators. A foundational book. By <a
|
||
href="https://github.com/raganwald">Reginald Braithwaite</a> (2016)</li>
|
||
<li><a
|
||
href="https://www.manning.com/books/functional-programming-in-javascript">Functional
|
||
Programming in JavaScript</a> teaches JavaScript developers functional
|
||
techniques that will improve extensibility, modularity, reusability,
|
||
testability, and performance. Through concrete examples and jargon-free
|
||
explanations, this book teaches you how to apply functional programming
|
||
to real-life development tasks. By Luis Atencio (2016)</li>
|
||
<li><a href="http://eloquentjavascript.net/">Eloquent JavaScript</a>. A
|
||
modern introduction to programming using JavaScript. By Marijn Haverbeke
|
||
(2014)</li>
|
||
<li><a
|
||
href="http://shop.oreilly.com/product/0636920028857.do">Functional
|
||
JavaScript</a> teaches how to create code that’s beautiful, safe, and
|
||
simple to understand and test by using JavaScript’s functional
|
||
programming support. By <a href="https://github.com/fogus">Michael
|
||
Fogus</a> (2013)</li>
|
||
<li><a href="https://www.manning.com/books/grokking-simplicity">Grokking
|
||
Simplicity</a> teaches functional programming from first principles. It
|
||
uses JavaScript for all code examples and it uses real-world scenarios.
|
||
By <a href="https://github.com/ericnormand">Eric Normand</a> (2019)</li>
|
||
<li><a
|
||
href="https://github.com/kongware/scriptum/blob/master/README.md">scriptum</a>
|
||
- a no-frills functional programming library and a online course based
|
||
on it</li>
|
||
</ul>
|
||
<h3 id="articles">Articles</h3>
|
||
<ul>
|
||
<li><a
|
||
href="https://medium.com/@collardeau/intro-to-functional-programming-concepts-in-javascript-b0650773139c">FP
|
||
Concepts in JavaScript</a> – An introduction to Functional Programming
|
||
Concepts in JavaScript. Uses the Ramda library to teach the concepts of
|
||
composition, pointfree style, and functors through the simplest of
|
||
examples.</li>
|
||
<li><a
|
||
href="http://stephen-young.me.uk/2013/01/20/functional-programming-with-javascript.html">Functional
|
||
programming with JavaScript</a> – Another introduction to Functional
|
||
Programming in JavaScript with a focus on three key themes: computation
|
||
as the application of functions, statelessness, avoiding side
|
||
effects.</li>
|
||
<li><a
|
||
href="http://jrsinclair.com/articles/2016/gentle-introduction-to-functional-javascript-intro/">A
|
||
gentle introduction to functional JavaScript</a> – A four-part series
|
||
introduction functional programming in JavaScript that gets you up to
|
||
speed what all the hype about functional programming is all about.</li>
|
||
<li><a
|
||
href="https://dev.to/snird/functors-from-first-principle-37lh">Functors
|
||
from first principle - explained with JS</a> - Explaining functors
|
||
concept using JavaScript.</li>
|
||
<li><a href="https://hughfdjackson.com/javascript/why-curry-helps/">Why
|
||
Curry Helps</a> – A short overview of how to write reusable and
|
||
declarative code using currying.</li>
|
||
<li><a href="http://fr.umio.us/favoring-curry/">Favoring Curry</a> -
|
||
Practical applications of currying using Ramda.</li>
|
||
<li><a
|
||
href="http://blog.jenkster.com/2016/06/functional-mumbo-jumbo-adts.html">Functional
|
||
Mumbo Jumbo – ADTs</a> – A beginner-friendly introduction to Algebraic
|
||
Data Types.</li>
|
||
<li><a
|
||
href="https://medium.com/@yelouafi/javascript-and-type-thinking-735edddc388d">JavaScript
|
||
and Type Thinking</a> – Learn to reason about your JavaScript code with
|
||
<em>type thinking</em>. Algebraic Data Types are introduced as a
|
||
conceptual basis to reason about program entities.</li>
|
||
<li><a
|
||
href="https://codewords.recurse.com/issues/four/lazy-composable-and-modular-javascript">Lazy,
|
||
composable, and modular JavaScript</a> – Use four new features of ES6 –
|
||
iterables, generators, fat arrows, and for-of – in conjunction with
|
||
higher-order functions, function composition, and lazy evaluation, to
|
||
write cleaner and more modular JavaScript.</li>
|
||
<li><a href="http://fr.umio.us/why-ramda/">Why Ramda</a> – To those not
|
||
used to functional programming, Ramda seems to serve no purpose
|
||
whatsoever. However, it does offer a different style of coding, a style
|
||
that’s taken for granted in purely functional programming languages:
|
||
Ramda makes it simple for you to build complex logic through functional
|
||
composition.</li>
|
||
<li><a href="https://curiosity-driven.org/monads-in-javascript">Monads
|
||
in JavaScript</a> – An introduction to the Monad design pattern in
|
||
JavaScript.</li>
|
||
<li><a
|
||
href="http://robotlolita.me/2013/12/08/a-monad-in-practicality-first-class-failures.html">A
|
||
Monad in Practicality: First-Class Failures</a> – A walk through some
|
||
practical use cases for specific monadic structures in JavaScript: use
|
||
the <code>Maybe</code> monad to handle simple failure cases and model
|
||
more complex scenarios with the <code>Either</code> monad or the
|
||
<code>Validation</code> applicative functor.</li>
|
||
<li><a href="https://glebbahmutov.com/blog/tags/functional/">Functional
|
||
programming</a> – Many articles on various aspects of functional
|
||
programming in JavaScript by Gleb Bahmutov.</li>
|
||
<li><a
|
||
href="https://github.com/hemanth/functional-programming-jargon">Functional
|
||
Programming Jargon</a> – Jargon from the functional programming world
|
||
explained in JavaScript.</li>
|
||
<li><a
|
||
href="http://blog.benoitvallon.com/data-structures-in-javascript/data-structures-in-javascript/">Data
|
||
Structures in JavaScript</a> – A series of blog posts that reimplements
|
||
various data structures in JavaScript to better understand their
|
||
benefits and downsides.</li>
|
||
<li><a
|
||
href="https://medium.com/@cscalfani/so-you-want-to-be-a-functional-programmer-part-1-1f15e387e536">So
|
||
You Want to be a Functional Programmer</a> - Easy to understand, with
|
||
some examples, introduction to Functional Programming in Javascript and
|
||
Elm.</li>
|
||
<li><a
|
||
href="https://medium.com/@chetcorcos/functional-programming-for-javascript-people-1915d8775504">Functional
|
||
Programming for JavaScript People</a> - A complete introduction to
|
||
functional programming patterns by Chet Corcos with a lot of javascript
|
||
examples.</li>
|
||
<li><a href="https://auth0.com/blog/intro-to-immutable-js/">Introduction
|
||
to Immutable.js and Functional Programming Concepts</a> - Learn about
|
||
functional data structures and their uses in this overview of Facebook’s
|
||
popular library for JavaScript: Immutable.js.</li>
|
||
<li><a
|
||
href="https://medium.com/javascript-scene/master-the-javascript-interview-what-is-functional-programming-7f218c68b3a0">Master
|
||
the JavaScript Interview: What is Functional Programming?</a> - A simple
|
||
introduction by <span class="citation"
|
||
data-cites="ericelliott">@ericelliott</span> to functional principles
|
||
and vocabulary.</li>
|
||
<li><a
|
||
href="https://medium.com/javascript-scene/the-rise-and-fall-and-rise-of-functional-programming-composable-software-c2d91b424c8c">Composing
|
||
Software</a> - A series of articles on learning functional programming
|
||
and compositional software techniques in JavaScript ES6+ from the ground
|
||
up by <span class="citation"
|
||
data-cites="ericelliott">@ericelliott</span>.</li>
|
||
<li><a
|
||
href="https://dev.to/simov/anonymous-recursion-in-javascript">Anonymous
|
||
Recursion in JavaScript</a> - Short and easy to understand article about
|
||
implementing anonymous recursion in JavaScript.</li>
|
||
<li><a
|
||
href="https://joecortopassi.com/articles/functional-composition-in-javascript/">Functional
|
||
Composition in Javascript</a> – Step by step explanation of how to
|
||
compose functions in javascript.</li>
|
||
<li><a
|
||
href="https://medium.freecodecamp.org/functional-programming-principles-in-javascript-1b8fc6c3563f">Functional
|
||
Programming Principles in Javascript</a> - Practical code examples to
|
||
learn functional programming concepts like pure function, immutability,
|
||
first-class entities, and higher order functions</li>
|
||
<li><a
|
||
href="https://dev.to/rametta/basic-monads-in-javascript-3el3">Basic
|
||
Monads in Javascript</a> - Introduction to 2 easy monads in Javascript,
|
||
Maybe & Either.</li>
|
||
<li><a href="https://dev.to/rametta/f-for-js-devs-2b88">F# for
|
||
JavaScript Devs</a> - Showcasing the similarities between F# and
|
||
JavaScript</li>
|
||
<li><a
|
||
href="https://medium.com/@nadeesha/a-practical-guide-to-writing-more-functional-javascript-db49409f71">A
|
||
practical guide to writing more functional Javascript</a> - A step by
|
||
step guide to convert imperative JavaScript to more declarative,
|
||
functional JavaScript.</li>
|
||
<li><a href="https://github.com/you-dont-need/You-Dont-Need-Loops">You
|
||
don’t (may not) need loops ➿</a> - Loops are one of the first
|
||
constructs that junior programmers learn, but they can pose many
|
||
potential issues in the software development process, and could be
|
||
avoided in many cases.</li>
|
||
</ul>
|
||
<h3 id="videos">Videos</h3>
|
||
<ul>
|
||
<li><a
|
||
href="https://www.youtube.com/watch?v=h_tkIpwbsxY&list=PLK_hdtAJ4KqX0JOs_KMAmUNTNMRYhWEaC">Classroom
|
||
Coding with Prof. Frisby</a> – A series that builds a “practical” web
|
||
application with React and functional programming in JavaScript.</li>
|
||
<li><a href="https://www.youtube.com/watch?v=m3svKOdZijA">Hey
|
||
Underscore, You’re Doing It Wrong!</a> – Underscore.js claims to be a
|
||
functional programming library, but is it really?</li>
|
||
<li><a href="https://www.youtube.com/watch?v=AvgwKjTPMmM">Functional
|
||
programming patterns for the non-mathematician</a> – Learn about
|
||
practical use cases for functors, applicatives, and monads.</li>
|
||
<li><a href="https://vimeo.com/49384334">Pure JavaScript</a> – Christian
|
||
Johansen will show you how you can significantly up your game by leaving
|
||
loops behind and embracing functions as the primary unit of
|
||
abstraction.</li>
|
||
<li><a
|
||
href="https://www.youtube.com/playlist?list=PL0zVEGEvSaeEd9hlmCXrk5yUyqUag-n84">Functional
|
||
programming in JavaScript</a> - A series by Mattias Petter Johansson,
|
||
from the youtube channel FunFunFunction, that is specifically about
|
||
popularization of functional programming in JavaScript.</li>
|
||
<li><a
|
||
href="https://www.youtube.com/playlist?list=PLuPevXgCPUIMbCxBEnc1dNwboH6e2ImQo">Functional
|
||
Programming in TypeScript</a> - Discover functional programming with
|
||
Typescript and create a library like fp-ts alongside Sahand Javid in
|
||
this beginner-friendly YouTube playlist.</li>
|
||
<li><a href="https://www.youtube.com/watch?v=e-5obm1G_FY">Anjana Vakil:
|
||
Learning Functional Programming with JavaScript - JSUnconf 2016</a> - A
|
||
simple and understandable introduction of functional proramming in
|
||
javascript.</li>
|
||
<li><a href="https://www.youtube.com/watch?v=FYXpOjwYzcs">Functional
|
||
Programming Basics In ES6</a> - A complete introduction to functional
|
||
programming in javascript made it easy by ES6.</li>
|
||
<li><a href="https://www.youtube.com/watch?v=B0VoyujJWIE">JavaScript
|
||
Programmers Should Learn Algebraic Data Types – May 2018 – UtahJS
|
||
Lehi</a> - Seth House explains how ADTs (Algebraic Data Types) can be
|
||
useful to JavaScript developers.</li>
|
||
</ul>
|
||
<h3 id="examples-and-exercises">Examples and Exercises</h3>
|
||
<ul>
|
||
<li><a href="https://github.com/loop-recur/FPJS-Class">FPJS-Class</a> –
|
||
Functional Programming learned through JavaScript.</li>
|
||
<li><a
|
||
href="https://github.com/timoxley/functional-javascript-workshop">functional-javascript-workshop</a>
|
||
– The goal of this workshop is to create realistic problems that can be
|
||
solved using terse, vanilla, idiomatic JavaScript to teach fundamental
|
||
functional programming features of JavaScript.</li>
|
||
<li><a
|
||
href="https://github.com/paldepind/functional-frontend-architecture">functional-frontend-architecture</a>
|
||
– A functional frontend framework. Based on
|
||
Ramda + union-type-js + Flyd + Snabbdom</li>
|
||
<li><a href="https://github.com/sharkdp/cube-composer">cube-composer</a>
|
||
– A puzzle game inspired by functional programming.</li>
|
||
<li><a href="https://github.com/jaysoo/example-fp-youtube-search">FP
|
||
Youtube Search</a> – YouTube search app with ReactJS, Redux, and FP
|
||
concepts</li>
|
||
<li><a
|
||
href="https://frontendmasters.com/courses/functional-javascript/">Hardcore
|
||
Functional Programming in JavaScript</a> – Learn to apply techniques
|
||
from the forefront of computer science research to solve practical
|
||
problems in Javascript. Discover functional programming and see it
|
||
demonstrated step-by-step with how to build an example web app using
|
||
abstract interfaces like Monads, Functors, Monoids and Applicatives.
|
||
(<em>commercial</em>)</li>
|
||
<li><a
|
||
href="https://github.com/justsml/escape-from-callback-mountain">Escape
|
||
from Callback Mountain</a> - Design & refactoring tips for
|
||
Promise-based Functional JavaScript. Key benefits include better
|
||
readability, testability, and reusability. MIT.</li>
|
||
<li><a href="http://reactivex.io/learnrx/">Learn Rx</a> – A series of
|
||
interactive exercises introducing five basic ingredients of functional
|
||
(reactive) programming: the <code>map</code>, <code>filter</code>,
|
||
<code>concatAll</code>, <code>reduce</code>, and <code>zip</code>
|
||
functions.</li>
|
||
<li><a href="https://github.com/laberin/holdem-eval">Holdem
|
||
Evaluator</a> - Yet another Holdem Evaluator with Ramda functional
|
||
style</li>
|
||
</ul>
|
||
<h2 id="community">Community</h2>
|
||
<h3 id="related-lists">Related Lists</h3>
|
||
<ul>
|
||
<li><a href="https://github.com/stoeffel/awesome-frp-js">Awesome FRP
|
||
JS</a> – A curated list of awesome (functional) reactive programming
|
||
stuff in JavaScript.</li>
|
||
<li><a
|
||
href="https://github.com/lucasviola/awesome-functional-programming">lucasviola/Awesome
|
||
Functional Programming</a> – Awesome resources on functional programming
|
||
theory and learning materials.</li>
|
||
<li><a
|
||
href="https://github.com/xgrommx/awesome-functional-programming">xgrommx/Awesome
|
||
Functional Programming</a> – A ton of articles on functional
|
||
programming, as well as a huge list of functional libraries for many
|
||
programming languages.</li>
|
||
<li><a
|
||
href="https://github.com/busypeoples/functional-programming-javascript">Functional
|
||
Programming Resources In JavaScript</a></li>
|
||
<li><a
|
||
href="https://github.com/tk-learning-center/functional-programming-learning-path">tk-learning-center/Functional
|
||
Programming Learning Path</a> - A Learning Path for Functional
|
||
Programming</li>
|
||
</ul>
|
||
<h3 id="talk">Talk</h3>
|
||
<ul>
|
||
<li><a href="https://fpslack.com/">Functional Programming Slack
|
||
channel</a> – Community with a friendly channel for JavaScript as well
|
||
as many other channels about functional programming in general.</li>
|
||
</ul>
|
||
<h2 id="contribution">Contribution</h2>
|
||
<p>:star: Suggestions and PRs are welcome! :star:</p>
|
||
<p>Please read the <a href="./contributing.md">contribution
|
||
guidelines</a> to get started.</p>
|
||
<h2 id="license">License</h2>
|
||
<p><a href="http://creativecommons.org/publicdomain/zero/1.0/"><img
|
||
src="http://i.creativecommons.org/p/zero/1.0/88x31.png"
|
||
alt="CC0" /></a></p>
|
||
<p>To the extent possible under law, <a
|
||
href="http://stoeffel.github.io/">Christoph Hermann</a> has waived all
|
||
copyright and related or neighboring rights to this work.</p>
|