What the Heck IS a Monad?
“What the heck is a monad?” - You think to yourself as you drive home from work.
That weirdly passionate guy was making some interesting points about functional programming, but how would they even apply to real world problems? Endofunctors? What in the world are those?
“Ah, no need to worry myself about it now,” you say to yourself as you pull into the WcDonald’s drive through, ready for your wonderfully cold reward for working so hard all week. You pull up to the drive through and order a WcFlurry with {insert brand name candies here}. All is well in the worl-
“Sorry, our ice cream machine is broken.”
What? How could this be? All I wanted was a wonderful WcFlurry with scrumptious {insert brand name candies here} blended in! I didn’t even think about what I might do if I couldn’t order it, those machines never break around here! “What am I going to get now?” You zone out, staring into the LCD abyss of the ordering kiosk.
As you’re racing through your thoughts the car behind you starts honking. You weren’t sure whether it was at you or if there was some other reason, but it snaps you back into the present.
“Ok, uh, I’ll haaave… I guess a diet cola?” It wasn’t what you really wanted, but at least you’re making progress on getting somewhere.
“Large or Small?”
Drat!
Cars pile up in your rearview mirror, all waiting for their chance at an ice cold disappointment.
“I-I guess large,” you stammer out, sinking slightly into your seat.
“3.56, first window. Thank you.”
You drive home, with your sugar free, what seems to be half watered down, mostly ice, diet soda. The embarrassment of holding up a line because of your lack of preparedness etching itself into your mind with each sip.
You vow never to let that happen again. Next time you need an ice cream you will go to WcDonald’s and have a backup order on standby, something that doesn’t rely on the ice cream machine to dispense!
It’s a simple solution, but the difference is you are now aware of this issue ahead of time, so you can handle it immediately if it happens again and avoid that fail cascade of cars backing up behind you (even if they probably excused it as just a busy time of day).
So that settles it. Next time we’ll be prepared! Thankfully, having prevented a future catastrophe, you think back to when this problem started in the first place… Oh yeah. “What the heck is a monad?”