A monad is a special prayer used by software developers. In this simple guide, I’ll teach you how to build (we developers say “reify”!) a monad of your very own.
Start with the combinator function. A combinator is like a regular function except that the domain is partial and the range is delicate. Turn it clockwise two turns, unless it’s a Thursday in which case anticlockwise thrice. It should now look splendid and act vicarious.
git commit -m "praise be"
Note: if you’re scared of commitment you can skip this step.
Functions need arguments. Turn to your neighbour and ask if they too have taken Joel Spolsky as their Lord and saviour. That should do the trick!
git refund $20
Your monad must be well-formed. Take your monad and hold it between two fixed-points. Compile for 20 minutes or until the surface is golden.
If your monad starts to display behaviour issues, bind dynamically in a mixin bowl until generic.
At this stage, you should start to recognise the return-type of your monad. If it’s a higher-order function you might want to take it down a peg or two by applying further arguments. See the y-combinator blog for tips!
Your monad should now be complete. Decorate with variance and apply.
Your monad should give you many years of pleasure. Remember, if you encounter any problems you may need to execute. See the man page for details.