Skip to content

functional programming

dozens edited this page Oct 3, 2024 · 4 revisions

Functional Programming

A monad is just a monoid in the category of endofunctors.

Principles and Features of FP:

  • Immutable Data
  • Declarative
  • No Side Effects
  • Point Free
  • Composition

The curse of the monad is that... once you understand... you lose the ability to explain it to anyone else.

Douglas Crockford 2012 "Monads and Gonads" https://www.youtube.com/watch?v=dkZFtimgAcM

Set Theory and Category Theory

Burritos

The Result example here is most closely associated with what might be called an Either Monad.

https://gieseanw.wordpress.com/2024/06/25/you-probably-wrote-half-a-monad-by-accident/

A functor must also be equipped with a map function that lifts functions over the original type into functions over the new type. For example, you can add chopped jalapeños or shredded cheese to any type, like meat or beans; the lifted version of this function adds chopped jalapeños or shredded cheese to the corresponding burrito.

https://blog.plover.com/prog/burritos.html

Fact: If you have a source of Blobs, and a function that can turn a Blob into a Thing, you can put them together to create a source of Things.

https://www.jerf.org/iri/post/2958/

True Myth: A library for safe, idiomatic null and error handling in TypeScript, with Maybe and Result types, supporting both a functional style and a more traditional method-call style.

https://true-myth.js.org/#md:why-do-i-need-this

Clone this wiki locally