SciTech.blog
SciTech.blog
A monad is an abstract concept used in functional programming to sequence computation, but it can also be useful in OOP. Let's take a look at how to implement monads in Python.
Implementing monads in C++ is a little tricky, since there are no higher-kinded types. We can however use template specialisation to achieve the same effect.
Applicative functors are less general than functors but more general than monads, which makes them useful in some scenarios. Swift is sufficiently functional to admit a straightforward implementation.
...a monoid in the category of endofunctors. This enigmatic sentence keeps perplexing beginner programmers. In this post we dissect it so you don't have to read a whole book on category theory in order to understand what it means.