Wim Jongeneel
Mar 22, 2021

It is not really an or-choice, every monad is a functor and some functors are also monads.

A functor is mainly defined as something that implements a map function that allows you to transform it from a Functor<A> to a Functor<B> is such a way the only the value in the functor changes. This is why it is sometimes compared to a box, you update what is in the box but not the box itself.

A monad can be used to hide ('abstract') side effects, but that doesn't make it a monad. The main addition over a monad and a functor is the presence of a flatten ('join') function that turns a nested monad into a non-nested monad. You could see this as having a box of a box of a thing of which you can just discard the outer box without losing any information.

Wim Jongeneel
Wim Jongeneel

Written by Wim Jongeneel

Software Engineer at Mendix (Rotterdam, The Netherlands) • Student MSc Software Engineering • Functional programming enthusiast

No responses yet