Skip to content

Functional Programming

October 11, 2023
March 13, 2016

Most of the study gears towards JavaScript/Python/web development
Many old articles

reactive-programming
immutability

Functional programming - Wikiwand
Category:Functional programming - Wikiwand
Functional reactive programming - Wikiwand
Contrast: Imperative programming - Wikiwand

Why Functional Programming Matters (PDF)
What is functional reactive programming? | Packt Hub
What Making a Cup Of Tea Taught me about Functional Programming. think declaratively
What is Functional Reactive Programming (FRP)? - QuickBird Studios Blog
Jane Street Tech Blog - Breaking down FRP
The Functional Evolution of Object-Oriented Programming
初探 Functional Programming:徹底改變程式思維 - 基礎概念篇 - YouTube

Functional Programming buzzwords - DEV Community 👩‍💻👨‍💻 FRP is not FP

Why Isn't Functional Programming the Norm? – Richard Feldman - YouTube
Hey Underscore, You're Doing It Wrong! - YouTube more about function programming
GOTO 2018 • Functional Programming in 40 Minutes • Russ Olsen - YouTube
Functional Design Patterns - Scott Wlaschin - YouTube 1:05:49, F#
Essentials: Functional Programming's Y Combinator - Computerphile - YouTube


kriskowal/gtor: A General Theory of Reactivity
An introduction to functional programming
Functional Programming Principles in Javascript - freeCodeCamp.org - Medium
The Foundations of Functional Concurrency | Manning
rpominov/category-theory-notes
terminology - What is (functional) reactive programming? - Stack Overflow
functional-programming Series' Articles - DEV Community

Curry: cooking up tastier functions – JavaScript, JavaScript…
Compose: functions as building blocks – JavaScript, JavaScript…
JavaScript Partials – JavaScript, JavaScript…

Learn you Func Prog on five minute quick! • The Register
How can I learn to think like a functional programmer? - Quora
declarative as antithetical to imperative, and procedural as antithetical to functional

Lambda calculus

Lambda calculus - Wikiwand
Lambda Calculus - Computerphile - YouTube

Functor/Monad

programming with effects

Functor (functional programming) - Wikiwand
Monad (functional programming) - Wikiwand
What is a Monad? - Computerphile - YouTube

Functors, Applicatives, And Monads In Pictures - adit.io
Swift Functors, Applicatives, and Monads in Pictures

The Absolute Best Intro to Monads For Software Engineers - YouTube ❗!important
No Nonsense Monad & Functor - The foundation of Functional Programming by César Tron-Lozai - YouTube
Monads in Modern C++ - Georgi Koyrushki and Alistair Fisher - ACCU 2023 - YouTube
Brian Beckman: Don't fear the Monad - YouTube 1:07:10

// Monads
// allows extra works to be done out of main logic (`transform()`)
// `run()` can be chained with multiple `transform()`s
// `run()` could be a function of `Option<T>` in some languages
// e.g.: missing value checking, log accumulation, transform pipeline

// Wrapper Type (monad type, wraps a raw type)
// `Option`, `Future`
type Option<T>;

// Wrap function: convert raw type to monad type
// `return`, `pure`, `unit`
function some<T>(x: T): Option<T> {};

// Run function: takes wrapper type and transform function
// bind, flatMap, >>=
function run<T>(
  input: Option<T>, transform: (_: T) => Option<T>
): Option<T> {
  if (input == none) return none;
  return transform(input.value);
};

Functors and Monads - Practical introduction to Functional Programming with JS
Contravariant Functors in TypeScript | by Wim Jongeneel | Hoppinger | Medium
Covariance and Contravariance in TypeScript

A type T is covariant if having S <: P, then T<S> <: T<P>.
A type T is contravariant if having S <: P, then T<P> <: T<S>.

// === means deep equal here

// identity
myFunctor.map((x) => x) === myFunctor;

// composition === chaining
myFunctor.map((x) => f(g(x))) === myFunctor.map(g).map(f);

Recursion

Recursion (computer science) - Wikiwand
Fantastic tail calls, and how to implement them - Leaning Technologies

Currying

Currying is the technique of translating the evaluation of a function that takes multiple arguments (or a tuple of arguments) into evaluating a sequence of functions, each with a single argument (partial application)

Understanding Currying in JavaScript – Bits and Pieces
A Beginner's Guide to Currying in Functional JavaScript

HoC

Understanding Higher Order Functions in JavaScript - Level Up Coding

Video

Functional programming in JavaScript - YouTube Fun Fun Function
Carefully Composing Logic: Functional JavaScript on Vimeo


Elm

Elm is designed to be a functional language compiled to JavaScript for frontend development.

Elm Whitepaper (PDF)
Elm GitHub org
Elm Blog
Elm Docs

0.17 is a major update, replaced signals with subscriptions in 2016
A Farewell to FRP
elm-platform/0.17.md at master · elm-lang/elm-platform

Beginning Elm: a gentle introduction to Elm programming language - Beginning Elm
Introduction · An Introduction to Elm
Beginning Elm: a gentle introduction to Elm programming language - Beginning Elm
Elm for the Frontend, Right Now (Updated for Elm 0.18) - Bendyworks
evancz/elm-architecture-tutorial: How to create modular Elm code that scales nicely with your app
sporto/elm-patterns: A collection of common patterns for Elm
Elm: A Beginners' Guide to Elm and Data - SitePoint Premium
Elm Web Development Chapter 1 - SitePoint Premium

christianalfoni - Exploring Elm part1
christianalfoni - Exploring Elm part2

#191: Elm and Functional Programming with Richard Feldman - Changelog

Elm — Monday Morning Haskell
Elm: More Functional Frontend! – Hacker Noon
how-to-use-elm-at-work
Start Using Elm to Build Web Applications from @splodingsocks on @eggheadio

Packages

Elm Packages

elm-lang/elm-reactor: Interactive development tool that makes it easy to develop and debug Elm programs.

lovasoa/graphdraw: Graphical User Interface for drawing graphs in elm

sporto/erl: URL parsing library for ELM
sporto/hop: Navigation and routing helpers for single page applications in Elm

F

F# Software Foundation
F Sharp (programming language) - Wikiwand

F# | Functional programming for .NET
F# docs - get started, tutorials, reference. | Microsoft Docs

dotnet fsi: interactive prompt

playground
Try F#
WebAssembly F# Compiler

Home | F# for fun and profit
F# Programming - Wikibooks, open books for an open world
ChrisMarinos/FSharpKoans: A simple, fun, and interactive way to learn the F# language through testing.

14 excellent reasons to use F# | InfoWorld
F# 5: A New Era of Functional Programming with .NET

Using F# for Desktop Apps | The F# Software Foundation

Fable: JavaScript you can be proud of!
Ionide IDE for F# (VSCode)
Bolero: F# in WebAssembly

Grain

Grain: A strongly-typed functional programming language for the modern web.
Grain, a WebAssembly functional language - Interview with co-author Oscar Spencer - YouTube

Haskell

Haskell Language
Haskell (programming language) - Wikiwand

HaskellWiki
Monad - HaskellWiki

The Haskell Tool Stack
[Haskell-community] Haskell Platform as the default recommendation considered harmful
Haskell Web Skills — Monday Morning Haskell

Haskell use monads to carry out side effects
Optionals and errors in Haskell & Rust - Monads by example - YouTube

bitemyapp/learnhaskell: Learn Haskell
A Happy Haskell
Learn You a Haskell for Great Good!
Real World Haskell
School of Haskell | School of Haskell
NICTA/course: Functional Programming Course

Haskell Stack Mega-Tutorial - YouTube
LambdaConf 2015 - How to Learn Haskell in Less Than 5 Years Chris Allen - YouTube

#198: Haskell Programming with Chris Allen and Julie Moronuki - Changelog
Into the Core - Squeezing Haskell into Nine Constructors by Simon Peyton Jones - YouTube

Packages

Introduction | Hackage

Erlang

Erlang Programming Language
Erlang (programming language) - Wikiwand
Structure and Interpretation of Computer Programs
rvirding/lfe
Learn You Some Erlang for Great Good!
The Erlang Runtime System the BEAM book

Erlang, a Language for the Internet of Things - The New Stack
Stuff Goes Bad: Erlang in Anger

Erlang Solutions - YouTube

Erlang.mk

erg-lang/erg: A Python-compatible statically typed language

Elixir

The Elixir programming language
Elixir Documentation - The Elixir programming language

Awesome Elixir | LibHunt
slashdotdash/awesome-elixir-cqrs: A curated list of awesome Elixir and Command Query Responsibility Segregation (CQRS) resources.
h4cc/awesome-elixir: A curated list of amazingly awesome Elixir and Erlang libraries, resources and shiny things. Updates:

Learning resources - The Elixir programming language
Erlang/Elixir Syntax: A Crash Course - The Elixir programming language
Elixir School
Joy of Elixir
Try Elixir | Code School

Learning Elixir: First Impressions · Abu Ashraf Masnun
Why choose Elixir for software development | Skcript
Elixir-koans by elixirkoans

ElixirCasts - Elixir and Phoenix Screencasts

The Human Side of Elixir-Alex Koutmos | Engineering Blog

How does Elixir compile/execute code? – Xavier Noria – Medium
Comparing Elixir and Go - via @codeship | via @codeship

Concurrency in Elixir - via @codeship | via @codeship
Linking, Monitoring, and Supervising in Elixir - via @codeship | via @codeship

Craft and deploy bulletproof embedded software in Elixir — Nerves Project
Elixir, Phoenix, Absinthe, GraphQL, React, and Apollo: an absurdly deep dive - Zach Schneider
How Discord Scaled Elixir to 5,000,000 Concurrent Users

Hex package manager
Mix project generator, build tool
IEx REPL

#194: Elixir with José Valim - Changelog
#147: Elixir and Phoenix with Chris McCord - Changelog
Phoenix and Elm – Making the Web Functional

Phoenix Rails-like web framework
Comparing Rails and Phoenix: Part I - via @codeship | via @codeship
Comparing Rails and Phoenix: Part II - via @codeship | via @codeship

elixir-ecto/ecto: A database wrapper and language integrated query for Elixir

Building a web framework from scratch in Elixir
Minimal Elixir JSON RESTful API - Kamil Lelonek - Software Engineer

sger/ElixirBooks: List of Elixir books

#perfmatters

Using Rust to Scale Elixir for 11 Million Concurrent Users
How Discord Scaled Elixir to 5,000,000 Concurrent Users

OTP

Open Telecom Platform - Wikiwand
What is OTP? | Learn You Some Erlang for Great Good!
The Architecture of Open Source Applications: Riak and Erlang/OTP
An Erlang OTP tutorial for beginners — A bot blog

Kotlin

Arrow Functional companion to Kotlin's Standard Library
Functional Programming with Kotlin and Arrow: Getting Started | raywenderlich.com

JavaScript

Fundamentals of Functional JavaScript - DEV Community series
Functional Programming in Javascript === Garbage « Thomas Reynolds

stoeffel/awesome-fp-js: A curated list of awesome functional programming stuff in js

An Introduction to Functional JavaScript
An Introduction to Reasonably Pure Functional Programming
Functional JavaScript: Building data structures from functions | InfoWorld
Recursion in Functional JavaScript
Higher-Order Functions in JavaScript
Course Introduction to Just Enough Functional Programming In JavaScript from @kyleshevlin on @eggheadio

What Is a Pure Function in JavaScript? deterministic (only rely on input) and has no side effects

The Two Pillars of JavaScript — Pt 2: Functional Programming — JavaScript Scene — Medium
Understanding recursion in functional JavaScript programming
Polymorphic functions and method dispatch in JavaScript

Getting Functional with Javascript (Part 1)
Getting Functional with Javascript (Part 2)
Getting Functional with Javascript (Part 3)

Functional JS #1: Introduction – DailyJS – Medium
Functional JS #2: Functions. Duh! – DailyJS – Medium
Functional JS #7: Point-free style | by Krzysztof Czernek | DailyJS | Medium

Introduction to Algebraic Structures — Functional Programming for JavaScript Developers
Understanding Functional Programming in Javascript — A Complete Guide

array.reduce()
Understanding the Almighty Reducer | CSS-Tricks
Array.prototype.reduce() - JavaScript | MDN
JavaScript has a Reduce Method. You Should Use It. - Level Up Coding

lodash FP Guide · lodash/lodash Wiki
Underscore.js
you-dont-need/You-Dont-Need-Lodash-Underscore: List of JavaScript methods which you can use natively + ESLint Plugin
Why is Lodash Still Useful? - Level Up Coding

wu.js — Higher order functions for ECMAScript 6 iterators
alexreardon/memoize-one: A memoization library which only remembers the latest invocation

getify/Functional-Light-JS: Pragmatic, balanced FP in JavaScript. @FLJSBook on twitter.

functional js
FredyC/promised-land
jussi-kalliokoski/trine
LUISATENCIO.NET

Immutability in JavaScript:
Immutable.js
planttheidea/unchanged: A tiny, fast, unopinionated handler for updating JS objects and arrays immutably
arqex/freezer: A tree data structure that emits events on updates, even if the modification is triggered by one of the leaves, making it easier to think in a reactive way.

see reactive-programming.md#rx

Bacon.js

Bacon.js - Functional Reactive Programming library for JavaScript Tutorials

Source:
baconjs/bacon.js
baconjs/bacon.jquery
baconjs/bacon.matchers: Matchers API for Bacon.js
baconjs/bacon.model: Model plugin for bacon.js
raimohanska/worzone: Game programming experiment with Bacon.js (no more RxJs)

Tutorials:
Bacon.js for dummies | Neethack basic definition of terms
javascript - Bacon.js: practical difference between a stream and a property - Stack Overflow
Sean Voisen » Learning FRP with Bacon.js by Way of Underscore
Bacon.js Cheat Sheet by ProLoser - Cheatography.com

Bacon.js blog
Bacon.js blog: Chicken, Egg and Bacon.js UI pattern
Bacon.js blog: Wrapping Things in Bacon
We Don't Need No Stinkin' Frameworks: Writing Web Apps with Bacon.js and virtual-dom
Login form with Bacon.js | npmawesome.com
Reactive UIs with React & Bacon — Josh Bassett
Stephen Young - Functional programming with Javascript
Stephen Young - Writing functional applications with Functional Reactive Programming and Bacon.js

// jQuery
$("#clickme").on("click", function (event) {
  alert(event.target);
});

// Bacon
clicked = $("#clickme").asEventStream("click");
clicked.onValue(function (event) {
  alert(event.target);
});

Videos:
Enemy of the State: An introduction to functional reactive programming with Bacon.js - YouTube
Philip Roberts: Enemy of the state: An introduction to Functional Reactive Programming and Bacon.js on Vimeo

Ramda

Ramda Documentation
ramda/ramda: :ram: Practical functional Javascript

Hands-on Functional Programming with Ramda.js
Functional Programming Patterns With RamdaJS
Functional Programming Patterns With RamdaJS!

Remeda

Remeda supports both "data-first" and "data-last" API
remeda/remeda: A utility library for JavaScript and TypeScript.

Monet

monet.js - Powerful abstractions for JavaScript
monet/monet.js: monet.js - Monadic types library for JavaScript

Practical Intro to Monads in JavaScript – Evojam Technology Blog
Practical Intro to Monads in JavaScript: Either – Evojam Technology Blog
Practical Intro to Monads in JavaScript: Validation – Evojam Technology Blog

Deep Waters

antonioru/deep-waters: 🔥Deep Waters is an easy-to-compose functional validation system for javascript developers 🔥
What is Deep Waters - Deep Waters

Kefir.js

Kefir.js — fast and light Reactive Programming library for JavaScript inspired by Bacon.js and RxJS
kefirjs/kefir: A Reactive Programming library for JavaScript

PureScript

PureScript
Try PureScript!
purescript/purescript: A strongly-typed language that compiles to JavaScript

PureScript by Example by Phil Freeman [Leanpub PDF/iPad/Kindle]
Functional Programming Concepts in Purescript from @cmdv on @eggheadio

Fantasy Land

Fantasy Land
fantasyland/fantasy-land: Specification for interoperability of common algebraic structures in JavaScript

Highland.js

Highland.js
caolan/highland: High-level streams library for Node.js and the browser

Folktale

Home | Folktale, a standard library for functional programming in JavaScript
origamitower/folktale: [not actively maintained!] A standard library for functional programming in JavaScript

Fun With Folktale - YouTube
Easier Asynchronous State Modelling in React Redux or Hooks

Folktale 2 | Folktale, a standard library for functional programming in JavaScript

Fun With Folktale - YouTube

OCaml

learn-to-code#OCaml

Python

An introduction to functional programming
Functional programming in Python: Immutable data structures | Opensource.com

Coconut Programming Language
evhub/coconut: Simple, elegant, Pythonic functional programming.
Coconut Tutorial — Coconut documentation

i2y/mochi: Dynamically typed functional programming language uses pyrsistent
Functional Python with Mochi · EuroPython 2015 · Bilbao, 20–26 July 2015

tobgu/pyrsistent: Persistent/Immutable/Functional data structures for Python
Welcome to Pyrsistent’s documentation!

Welcome to Hy’s documentation! Lisp inspired
try-hylang

dry-python/returns: Make your functions return something meaningful, typed, and safe!
Monadic error handling in Python ⚠ Write better Python code part 7b - YouTube Go-like (result, err) tuple

dg — it's a Python! No, it's a Haskell! Haskell inspired
pyos/dg: A programming language for the CPython VM.
dg — kind of a tutorial.

Packages

Pursuit package repo
PureScript GitHub org

purescript-thermite - Pursuit wrapper for React

Racket

Racket
racket/racket: The Racket repository

Package Management in Racket
Racket Package Index

Framework: Racket GUI Application Framework