Skip to main content

3 posts tagged with "functional-programming"

View All Tags

Monads: Either or Result

· 7 min read
Pere Pages
Software Engineer

functional

Both Result and Either types are considered monads in functional programming. They are commonly used for error handling and control flow in languages that support functional programming paradigms, such as Haskell, Scala, and even in TypeScript with certain libraries.

Both Result and Either are monads because they implement the monadic interface, specifically the bind (or flatMap, andThen) function, and satisfy the monad laws (Identity and Associativity).

These types are powerful abstractions for dealing with computations that might fail, providing a way to sequence operations while propagating errors in a clean, functional way.

What stuck with me from Functional Programming in JavaScript

· 14 min read
Pere Pages
Software Engineer
Cover of the book Functional Programming in JavaScript by Luis Atencio

I read "Functional Programming in JavaScript" by Luis Atencio a while ago, and rather than walk through it chapter by chapter, I want to pull out the handful of ideas that actually changed how I write JavaScript. These are my notes on the bits that stuck — the concepts I keep reaching for, with small examples to make them concrete.

The book leans heavily on Lodash.js and Ramda.js, so a few examples use them.

Published 2017

Some of the "what JavaScript engines support" details have aged. I've called those out where they matter.

Grokking Simplicity: Taming complex software with functional thinking by Eric Normand

· 11 min read
Pere Pages
Software Engineer

"Grokking Simplicity: Taming Complex Software with Functional Thinking" by Eric Normand is a book that introduces the principles of functional programming in a practical and approachable way. It focuses on simplifying complex software development tasks by applying functional programming concepts.

The book teaches how to write simpler, cleaner, and more reliable code by avoiding shared state, mutable data, and side-effects. It's particularly useful for developers who are accustomed to object-oriented programming and want to explore functional paradigms.

grokking simplicity book cover
Published 2021