Skip to content

Latest commit

 

History

History
148 lines (139 loc) · 26.4 KB

functional-programming.md

File metadata and controls

148 lines (139 loc) · 26.4 KB

Functional Programming

Context: frontend-dev-bookmarks / Architecture

Functional programming is a programming paradigm, that treats computation as the evaluation of mathematical functions and avoids changing-state and mutable data.

frontend.directory Gitter Twitter


  • A Gentle Introduction to Functional JavaScript: A 3 part series, by Derick Bailey featuring Chet Harrison, about functional programming with many examples in JavaScript.
  • A Million Ways to Fold in JS: Brian Lonsdorf provides many functional alternatives to loops in this video.
  • Adventures in Functional Programming: A talk by Jim Weirich, demonstrating how to use functional programming and lambda calculus to derive Y combinator.
  • Allong.es: allong.es is a JavaScript library based on the function combinator and decorator recipes introduced in the book JavaScript Allongé.
  • Barely Functional: Tiny (2.7kb) functional programming library using native es5/6 operations.
  • Basic Lazy Evaluation and Memoization in JavaScript: Memoization is a way of optimizing code so that it will return cached results for the same inputs.
  • Bilby.js: A functional library based on category theory with immutable multimethods, functional data structures, functional operator overloading, automated specification testing.
  • Composability: from Callbacks to Categories in ES6: The author borrows some ideas from functional languages to explore a different approach for addressing the callback hell.
  • Curry or Partial Application?: Eric Elliott describes the difference between partial application and curry.
  • Daggy: Library for creating tagged constructors with catamorphism.
  • Date FP: Functional programming date manipulation library.
  • Debugging Functional: This post will demonstrate a simple solution that can go a long way to enhance the debugging experience in functional JavaScript applications.
  • Deterministic: A weekly digest of interesting news and articles covering functional programming for the web, especially on the front end.
  • Example Projects: Open source projects which use functional programming, preferably point-free and side-effect-free.
  • FP DOM: A collection of functions to favor functional programming in a DOM context.
  • Fantasy Combinators: Combinators which are used for fantasy-land projects.
  • Fantasy Land: Specification for interoperability of common algebraic structures in JavaScript.
  • Fantasy Lenses: Composable, immutable getters and setters.
  • Functional Concepts For JavaScript Developers: Currying: Andrew Robbins talks about what currying is and why it's useful.
  • Functional Core Reactive Shell: Giovanni Lodi makes an overview of different architecture meta-patterns and describes his current findings about functional programming and observables as a way to control side effects.
  • Functional Frontend Architecture: This repository is meant to document and explore the implementation of what is known as "the Elm architecture". A simple functional architecture for building frontend applications.
  • Functional JavaScript Mini Book: Jichao Ouyang gives and introduction to functional programming with JavaScript and describes some Typeclasses like Functor and Monad.
  • Functional Javascript Workshop: The goal of this workshop is to create realistic problems that can be solved using terse, vanilla, idiomatic JavaScript.
  • Functional Principles In React: Jessica Kerr talks about four functional principles: Composition, Declarative Style, Isolation and Flow Of Data, and their usage in React.
  • Functional Programming Jargon: Jargon from the functional programming world in simple terms.
  • Functional Programming for JavaScript People: Chet Corcos explains different features of functional programming like composition, currying, lazy evaluation, referential transparency and compares Clojure with Haskell.
  • Functional Refactoring in JavaScript: In this article Victor Savkin shows how to apply functional thinking when refactoring JavaScript code. He does that by taking a simple function and transforming it into a more extendable one, which has no mutable state, and no if statements.
  • Functional.js: Functional.js is a functional JavaScript library. It facilitates currying and point-free / tacit programming and this methodology has been adhered to from the ground up.
  • Functionize: A collection of functions which aids in making non-functional libraries functional.
  • Futures and Monoids: Yassine Elouafi explains the nature of Monoids using Futures, Numbers and Strings as examples.
  • Hey Underscore, You're Doing It Wrong!: In this talk Brian Lonsdorf gently takes a shot at underscore.js for not thinking about currying and partial function application in its library design.
  • Immutability, Interactivity & JavaScript: We'll dive in and see how trees of JavaScript arrays can permit building efficient immutable collections. Then we'll see how embracing immutable values dramatically simplifies some classic hard problems in client side programming including but not limited to undo, error playback, and online/offline synchronization.
  • Immutable Sequence.js: High performance implementation of Immutable Sequence in JavaScript, based on Finger Tree.
  • Immutable.js: Immutable persistent data collections for Javascript which increase efficiency and simplicity.
  • JSAir - Functional and Immutable Design Patterns in JavaScript: An episode of JavaScript Air about "the how and why of functional programming and immutable design patterns in JavaScript" with Dab Abramov and Brian Lonsdorf as guests.
  • JavaScript and Type Thinking: Yassine Elouafi introduces Algebraic Data Types with an example of a simple and a recursive type.
  • Javascript Combinators by Reginald Braithwaite: In this talk, we'll explore functions that consume and return functions, and see how they can be used to build expressive programs that hew closely to JavaScript's natural style.
  • Lamda.js: This library takes all the methods on instances of strings, arrays, objects, numbers, and regexp's and turns them into functions that can be used in a pointfree way.
  • Lenses Quick n’ Dirty: A video by Brian Lonsdorf that introduces lenses.
  • Lenses and Virtual DOM Support Open Closed: Hardy Jones explains how Lenses work using a simple example of working with Virtual DOM.
  • Lenses.js: Composable kmett style lenses.
  • Lodash/fp: The lodash/fp module is an instance of lodash with its methods wrapped to produce immutable auto-curried iteratee-first data-last methods.
  • Making your JavaScript Pure: Jack Franklin compares pure and impure functions and describes how to leverage functional programming principles in JavaScript.
  • Monads: Composable computation descriptions. The essence of monad is thus separation of composition timeline from the composed computation's execution timeline, as well as the ability of computation to implicitly carry extra data.
    • Collections of Monads: Libraries of monad implementations.
      • Akh: Akh includes a basic set of common monad transformers, along with monads derived from these transformers. Akh structures implement the Fantasy Land specification.
      • Folktale: Folktale is a suite of libraries for generic functional programming in JavaScript that allows you to write elegant modular applications with fewer bugs, and more reuse.
      • Monet.js: Monet is a tool bag that assists Functional Programming by providing a rich set of Monads and other useful functions.
    • Continuation Monad: Represents computations in continuation-passing style (CPS). In continuation-passing style function result is not returned, but instead is passed to another function, received as a parameter (continuation).
    • Either Monad: The Either type represents values with two possibilities: a value of type Either a b is either Left a or Right b. It is often used for error handling.
    • Free Monad: A free monad satisfies all the Monad laws, but does not do any computation. It just builds up a nested series of contexts. The user who creates such a free monadic value is responsible for doing something with those nested contexts.
    • Futures: Futures represent the value arising from the success or failure of an asynchronous operation (I/O).
      • Fluture: The debuggable Fantasy Land Future library.
      • Folktale Task: A structure for time-dependent values, providing explicit effects for delayed computations, latency, etc.
      • From Callback to Future -> Functor -> Monad: Yassine Elouafi goes through a simple implementation of Futures and compares them to Promises.
      • Future IO: A fantasy-land compliant monadic IO library for Node.js.
      • Futurizer: Turn callback-style functions or promises into futures!
    • Introduction: Introductory materials about monads.
    • Maybe Monad: Using Maybe is a good way to deal with errors or exceptional cases without resorting to drastic measures such as error. It is a simple kind of error monad, where all errors are represented by Nothing. A richer error monad can be built using the Either type.
    • Reader Monad: Represents a computation, which can read values from a shared environment, pass values from function to function, and execute sub-computations in a modified environment.
    • Transformers: Special types that allow us to roll two monads into a single one that shares the behavior of both.
      • Akh: Akh includes a basic set of common monad transformers, along with monads derived from these transformers. Akh structures implement the Fantasy Land specification.
      • Fantasy ArrayT: Monad transformer for JavaScript Arrays.
      • Monad Transformers: Monad transformers are tricky, they require an excessive amount of type juggling. One of the aims of this package is to reduce the amount of wrapping and unwrapping needed for making a new transformer and to provide an easy way to define and combine transformers.
      • Monad Transformers Library: Practical monad transformers for JS.
    • Validation Monad: A disjunction that is appropriate for validating inputs and aggregating failures.
  • Mori: A library for using ClojureScript's persistent data structures and supporting API from the comfort of vanilla JavaScript.
  • Mostly Adequate Guide to Functional Programming: A book by Brian Lonsdorf that introduces algebraic functional programming in JavaScript.
  • Nanoscope: Nanoscope is a javascript library designed to make complex transformations of data much easier. It is a built on the idea of a functional Lens - a construct that enables focusing on sub-parts of data structures to get and modify.
  • Pointfree Fantasy: Point-free wrappers for fantasy-land. Functions are curried using lodash's curry function, and receive their data last. Gives us aliases with our familar haskell names as well.
  • Pointfree Javascript: In this post Lucas Reis presents what is called pointfree style programming and goes through some common scenarios to demonstrate its benefits.
  • Practical Functional Programming: Pick Two: James Coglan tries to show in this video how to use functional concepts in daily JavaScript programming.
  • Promises + FP = Beautiful Streams: Yassine Elouafi show how to use functional programming and algebraic data types to derive a pure functional definition of reactive programming like streams.
  • Pure JavaScript: Christian Johansen shows you how you can up your game by leaving loops behind and embracing functions as the primary unit of abstraction.
  • Pure UI: Guillermo Rauch discusses the definition of an application’s UI as a pure function of application state.
  • PureScript: PureScript is a strongly, statically typed language which compiles to JavaScript. It is written in and inspired by Haskell.
  • Ramda: A practical library designed specifically for a functional programming style, one that makes it easy to create functional pipelines, one that never mutates user data.
    • Practical Ramda - Functional Programming Examples: Tom MacWright gives some practical examples of Ramda usage.
  • Ramda Fantasy: Fantasy Land compatible types for easy integration with Ramda. This is an experimental project and will probably merge with Sanctuary.
  • Sanctuary: Sanctuary is a functional programming library inspired by Haskell and PureScript. It depends on and works nicely with Ramda. Sanctuary makes it possible to write safe code without null checks.
  • The Little Idea of Functional Programming: Jack Hsu tries to take a look at a couple of simple concepts that make up the little idea behind functional programming and to tie the concepts back to code examples in JavaScript.
  • Timm: Immutability helpers with fast reads and acceptable writes.
  • Transducers: Transducers are a powerful and composable way to build algorithmic transformations that you can reuse in many contexts.
  • Union Type: Union types are a way to group different values together. Union-type is a small JavaScript library for defining and using union types.

License

Creative Commons License
This work is licensed under a Creative Commons Attribution 4.0 International License.

Please provide a link back to this repository. This is not necessary for GitHub forks.