Monad-based Programming

Monad-based Programming

Computational monad is a concept that became important for programming during the recent two decades. Most distinctively it has been used in the design of Haskell programming language. Monads are the ingredient needed to bridge the gap between mathematical (pure) functions (such as + or exponential) and program functions (such as malloc or exception throwing). Roughly:

program function = mathematical function + computational monad
By solving this equation we obtain

computational monad = program function – mathematical function
The difference between program functions and mathematical functions is that program functions may have effects, which is whatever they may do meanwhile, like throw exception, write the state, run a random number generator. Monads are thus formal devices to capture effects.

Like in object-oriented programming any self-sustained concept is to be abstracted in a class, in Haskell any effect is to be abstracted in a monad.

Starting from this programming perspective in this course we are going to explore at depth the theory of monads, their significance to programming and beyond. We are going to establish links to concurrency, probabilistic programming, continuation passing style programming, etc. We are going to see that many concepts and ideas in programming can be formulated and understood in terms of monads. We are also going to explore the recently emerged paradigm of effect handling.