Re:Monads for functional programming (1995) [pdf]
by theoh on Sunday May 06, 2018 @01:57PM
(#17007409)
It sounds like you are literally offering to give a monad tutorial, which is brave because, notoriously, so many people have attempted that, usually using metaphors.
Wadler's misleadingly titled earlier paper "The Essence of Functional Programming" is actually more elementary than the one linked to, and gets to the core of the issue:
"2.1 What is a monad?
For our purposes, a monad is a triple (M,unitM,bindM) consisting of a type constructor
M and a pair of polymorphic functions.
unitM :: a -> M a
bindM :: M a -> (a -> M b) -> M b"
If you can read this code and understand what a type constructor is, then that is the most general, least metaphorical way to understand monads in FP.
Wadler's misleadingly titled earlier paper "The Essence of Functional Programming" is actually more elementary than the one linked to, and gets to the core of the issue:
"2.1 What is a monad?
For our purposes, a monad is a triple (M,unitM,bindM) consisting of a type constructor M and a pair of polymorphic functions.
unitM :: a -> M a
bindM :: M a -> (a -> M b) -> M b"
If you can read this code and understand what a type constructor is, then that is the most general, least metaphorical way to understand monads in FP.