JavaScript jrsinclair.com

Elegant error handling with the JavaScript Either monad  ↦

This is an absolute mindbender if you’re not already deeply in the functional world, but this post by James Sinclair is also a readable & fascinating look at how to incrementally move from a try/catch error management approach to a fully functional approach.

In this article, we’ll assume you already know about function composition and currying. If you need a minute to brush up on those, that’s totally OK. And a word of warning. If you haven’t come across things like monads before, they might seem really… different. Working with tools like these takes a mind shift. And that can be hard work to start with.


Discussion

Sign in or Join to comment or subscribe

Player art
  0:00 / 0:00