-
Notifications
You must be signed in to change notification settings - Fork 1
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
- https://github.com/getify/Functional-Light-JS/
- https://mostly-adequate.gitbooks.io/mostly-adequate-guide/content/
- https://medium.com/javascript-scene/composing-software-the-book-f31c77fc3ddc
- https://jrsinclair.com/articles/2022/javascript-function-composition-whats-the-big-deal/
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.