←back to thread

A list is a monad

(alexyorke.github.io)
153 points polygot | 3 comments | | HN request time: 0.493s | source
1. danieltanfh95 ◴[] No.44450440[source]
The obsession with trying to explain a monad ultimately stems from conflicting explanations and the inability to differentiate between a mathematical monad and monads implemented in software.

Monads in software are just a standard API for any given type. That’s it. Theres no magic here. Just implement the standard and you have a monad.

It grinds my gears seeing monad tutorial after tutorial using the wrong metaphors or misleading explanations

replies(2): >>44450870 #>>44450979 #
2. lmm ◴[] No.44450870[source]
Associativity is important, and not something that can be expressed in the API in most languages.
3. petesergeant ◴[] No.44450979[source]
> Monads in software are just a standard API for any given type. That’s it. Theres no magic here.

I don’t think that’s helpful for people to understand _why_ monads though, and that’s generally what people are looking for.