←back to thread

A list is a monad

(alexyorke.github.io)
153 points polygot | 1 comments | | HN request time: 0.244s | source
Show context
gr4vityWall ◴[] No.44446943[source]
I think the most intuitive description for a monad I've ever seen is 'flatMappable'.

Context: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

Usually articles that describe them in a very Math-y way go above my head. But the definition above was immediately clear (I saw it on HN).

I think this article is a bit more approachable than others I've read, but it still gets very confusing near the end.

replies(2): >>44446957 #>>44447634 #
aadhavans ◴[] No.44446957[source]
Could you elaborate on that? What does 'flatMappable' mean in this context?
replies(2): >>44447160 #>>44448214 #
1. gr4vityWall ◴[] No.44448214[source]
something that you can call flatMap() on.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...