Monads and JavaScript

There are countless articles that aim to describe what monads are. Sure, I can’t resist writing another one of my own. Stepping into contexts In order to understand what monad is, however, we should start with a Functor. The classical analogy for a functor is a box. The value sits inside that box. The only way to interact with that value is to use map function. Here is the signature for map:...

May 7, 2018 · 7 min

Implementation of function composition using spread operator and fat-arrow syntax

In this note, I would like to present my implementation of the function that performs function composition. We’re going to use spread operator and fat-arrow functions. First of all, it is not about writing shorter code or hacking around so that nobody understands it afterwards. If you are not familiar with this new syntax, you might find these two articles useful: fat-arrow functions and spread syntax. I’ll start with the initial, “old-school” implementation of comp function:...

September 9, 2016 · 3 min