Category Async

Promise as Functor (Video)

Idea: The Promise then can be seen as a map method that applies a function to the expected value.

Introduction to Asynchrony in Javascript

Concurrency, Parallelism, Asynchrony

Category Functors

Promise as Functor (Video)

Idea: The Promise then can be seen as a map method that applies a function to the expected value.

Maybe (aka Option) Monad in JavaScript

The problem of null or undefined is one of the biggest problems in computation theory. If we want to write meaningful programs, we must accept the fact that some computations...

Lazy functor

A thunk ()=>{…} is a subroutine used to inject an additional calculation into another subroutine. Thunks are primarily used to delay a calculation until its result is needed, or to...

IO functor

…continuing from Lazy Functor

Either Monad — A functional approach to Error handling in JS

In Error handling we have two possible paths either a computation succeeds or fails. The imperative way to control the flow is using exceptions and a try/catch block. In functional...

Introduction to Functors (Video)

The Idea: In JavaScript the most famous functional programming idea is to use array.map to replace iterations instead of for loops in order to transform the values of the array....

Category recursion

Monoids in JS

Alternatively, the fundamental notion of category theory is that of a Monoid — Categories for the Working Mathematician

Zip Arrays-Recursion Patterns in JS

This is an article about functional way to Zip two Arrays .

Folds-Recursion Patterns in JS

This is an article about functional Recursion on the Array data structure.

How to reverse a tree in JavaScript the Functional way in 5 lines of code

Trees are the single most important data structure in computer science, after lists. Just about everything you do in your programming career will be related to trees. For example JSON...

Category monads

Maybe (aka Option) Monad in JavaScript

The problem of null or undefined is one of the biggest problems in computation theory. If we want to write meaningful programs, we must accept the fact that some computations...

Either Monad — A functional approach to Error handling in JS

In Error handling we have two possible paths either a computation succeeds or fails. The imperative way to control the flow is using exceptions and a try/catch block. In functional...