What Is A Monad For Dummies

Without further ado…

In functional programming, a monad is a combination of “a data type” and “the operations that can be done to that type”.

So, an example of “a data type” might be “pill candy”, of which M&M’s and Skittles are examples, and an example of “the operations that can be done to them” would be “eat one” and “dump into bowl”.

The combination of the data type, and the operations that can be done to them, is a “monad”.

This is from a VOAT post you can find at https://voat.co/v/ELI5/2136846.

I have been asking about monads for years. Mostly, I was intrigued why it seemed to be so difficult for experienced programmers to talk about. They didn’t have that problem explaining what a variable was, but explaining monads seemed to make them tongue-tied.

The online explanations for monads are horrendous for newbie coders. I have read and attempted to read many and have come away more confused than when I started, very much feeling as if I were talking to a bunch of blind people touching different parts of an elephant and then proclaiming their description of that experience to be the whole experience of the elephant.

17. February 2018 by sojourner hardeman
Categories: geekery | Tags: , | 1 comment

One Comment

  1. Thank you for your explanation of the monad. I tried to understand it for a long time but now it is a lot clearer

Leave a Reply

Required fields are marked *