Skip to content

Instantly share code, notes, and snippets.

@miwillhite
Last active April 10, 2023 22:40
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save miwillhite/ca4a809202ed20fc515af43cd54cbbbb to your computer and use it in GitHub Desktop.
Save miwillhite/ca4a809202ed20fc515af43cd54cbbbb to your computer and use it in GitHub Desktop.
Functional JavaScript (and other)

Must Read

Functional Programming for JavaScript People

An introduction to functional thinking with examples in JavaScript.
https://medium.com/@chetcorcos/functional-programming-for-javascript-people-1915d8775504#.p0hyzlyjq

The Perfect API

A soft, informal introduction to the Fantasy Land spec.
https://james-forbes.com/?/posts/the-perfect-api

Versatility of Array methods

"A sneaky intro for programming with to monadic programming"
http://james-forbes.com/?/posts/versatility-of-array-methods

Functional Programming in JS

A more formal introduction to the FL spec.
https://medium.com/@rajaraodv/functional-programming-in-js-with-practical-examples-part-1-87c2b0dbc276#.l2j736i3z

The Marvellously Mysterious JavaScript Maybe Monad

A break down of a common imperative problem and how it can be solved using monads.
http://jrsinclair.com/articles/2016/marvellously-mysterious-javascript-maybe-monad/

Functors, Applicatives, And Monads In Pictures

A great introduction to Functors, Applicative and Monads.
http://adit.io/posts/2013-04-17-functors,_applicatives,_and_monads_in_pictures.html

Monad a Day Series

Some quick video introductions to common Monads:
https://vimeo.com/106008027
https://vimeo.com/109984691

Professor Frisby's Mostly Adequate Guide to Functional Programming

I've found this to be a key resource in understanding common patterns for implementing functional interfaces in JS
https://www.gitbook.com/book/drboolean/mostly-adequate-guide/details

Professor Frisby Introduces Composable Functional JavaScript

A fantastic expansion of the Mostly Adequate Guide.
https://egghead.io/courses/professor-frisby-introduces-composable-functional-javascript

Good to Read

The Little Idea of Functional Programming

A nice article with some good ideas and a strong start (though I'm not crazy about the end result).
http://jaysoo.ca/2016/01/13/functional-programming-little-ideas/

Futures

Futures vs Promises, focus on error handling.
https://github.com/rpominov/fun-task/blob/master/docs/exceptions.md

Futures

A detailed introduction to Futures as monads.
http://robotlolita.me/2014/03/20/a-monad-in-practicality-controlling-time.html

Refactoring JavaScript

Focus on the last chapter, Functional Refactoring.
http://refactoringjs.com/files/refactoring-javascript.pdf

Lenses

A nice intro to using Lenses for solving common problems.
https://joneshf.github.io/programming/2015/12/19/Lenses-and-Virtual-DOM-Support-Open-Closed.html

Reader Monad Examples

https://gist.github.com/MarkusPfundstein/dece230b540a3cf4053c0af0ee31f709
https://gist.github.com/MarkusPfundstein/246446e428ab10dbd2383cf3204a19d0

"Dynamic Dispatch" with strict typing

Disclaimer, this is a Haskell example. A great demonstration of making your nicely typed code extendable.
https://two-wrongs.com/dynamic-dispatch-in-haskell-how-to-make-code-extendable

Managing side effects

A simple idea on how to start managing side effects.
https://two-wrongs.com/the-case-for-controlled-side-effects

Escaping Hell with Monads

Not JS-specific: simple demonstration of using monads for solving common problems.
https://philipnilsson.github.io/Badness10k/posts/2017-05-07-escaping-hell-with-monads.html

Railway Oriented Programming

Not JS-specific: an expansion on using monads for solving common problems.
https://fsharpforfunandprofit.com/rop/

May Your Data Be Ever Coherent

Scala Example. Explaining some of the problems with if/else.
https://www.youtube.com/watch?v=gVXt1RG_yN0

https://medium.com/@yelouafi/javascript-and-type-thinking-735edddc388d#.xmc19y2gg https://github.com/stoeffel/awesome-fp-js/blob/master/README.md#videos https://github.com/jsverify/jsverify

Must View

Classic "Boundaries" talk

A high-level talk about how to structure your application using boundaries
https://www.destroyallsoftware.com/talks/boundaries

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment