
Monads are like a dildo factory, staffed by midgets - monksy
http://www.chrisstucchio.com/blog/2013/write_some_fucking_code.html
======
paulgb
> You didn’t learn python via abstract tutorial, comparing lists to Smaug and
> dicts to Bilbo [...]

> STFU and code. There is no other way to learn to code.

I think this is true of a lot of languages, but learning Haskell verges on
learning mathematical concepts at times and learning monads is definitely one
of those times. In these cases analogies are sometimes the easiest way to grok
the concepts.

~~~
gizmo686
I don't think this is necessarily true. I'm fairly strong in math, and
definitively enjoy approaching problems in the abstract. However, even in
math, it is often the case that by using something you gain an intuition about
how that thing behaves. Monads defiantly worked that way for me. I am good
enough at math that I could look at their definition and 'understand' what
they are doing (it really isn't complicated, its just difficult to explain).
However, when it came time to use them in code I had almost no intuition about
how they should behave. Now, my understanding of them is (in my opinion) not
at all the natural understanding that would arrive from their definition, but
an understanding that is accurate, and far more useful in code.

------
stormbrew
Seems like there's a monad tutorial posted here every week. This is by far the
best one.

Honestly, they mostly come across as condescending. At least this one's honest
about it.

------
Pherdnut
I salute this man. And I still don't know wtf Monads are.

~~~
gnuvince
Really? I thought that we had reached the point where the number of monad
tutorials exceeded all other computer science literature put together.

~~~
Pherdnut
I wasn't really trying. I mostly write JavaScript or try to bite through the
arteries in my wrists while suffering through other people's Java and C#.

------
angersock
So, maybe I'm just being overly provincial here--I rather suspect I am--but
does anybody else wish people could explain, to a three year old, why anyone
should give a fuck about monads?

They always seem to come up along with Haskell, and as far as I can tell they
seem mainly to be CS hipsterism.

So, pretend I'm a three-year old...or even better, pretend I'm a grumpy old C
programmer.

Can anyone here (please!) explain to me:

    
    
      1. What are monads (using grade-school language)?
    
      2. What does a monad in C look like (or C++, if you need template magic or OO stuff)?
    
      3. When will I use one outside of my Haskell class or Google interview?
    

EDIT: I gather that monads are some kind of weird thingy related to doing
proper function composition in type systems that would otherwise get in the
way, but maybe I'm smoking crack?

~~~
stormbrew
Disclaimer: I'm not a Haskell hipster and I personally think that people
trying to advocate that language and FP in general do themselves a huge
disservice by focusing so heavily on monads and other type calculus concepts
in introductory contexts.

1\. Monads are a means to create ordered evaluation in a system that does not
guarantee it as part of its execution model. You wrap actions in other actions
so that the act of unpeeling them results in computation occurring in a
predictable order. (not grade-school, but I do think it's more understandable
to a non-FP aficionado)

2\. They don't. Things always happen in a predictable sequence in C/C++.

3\. See 2.

~~~
angersock
Ah, so the main utility of them is helping to make ordering guarantees in a
language that would normally be more about mapping data points to their images
under a function?

That makes a great deal of sense, actually.

------
tonetheman
And I still do not know what a effin monad is...

~~~
MetaCosm
Did you try "stop reading fucking monad tutorials and write some code"?

------
cpdean
+1 for title. Don't understand monads still, so didn't read.

