←back to thread

A list is a monad

(alexyorke.github.io)
153 points polygot | 2 comments | | HN request time: 0s | source
Show context
kelseyfrog ◴[] No.44447589[source]
While I can understand the desire to draw a metaphor, there are better approaches than saying, "A List Is a Monad".

The statement as-is breaks pretty much immediately because, while there is a canonical list monad, there isn't a list monad, there are in fact several[1].

There are several more correct ways of phrasing the idea among:

"List can be given a monad instance"

"List forms a monad with pure and bind as defined"

"List is the underlying functor of a monad"

The point is that picking any old list implementation is likely not a monad without the supporting structure.

Will any of these help you learn what a monad is? Likely not. Monadology is a Mary's Room[2] problem; there is a qualia, a subjective sensation, when one understands monads having experienced them first hand. Subsequently monad tutorials are the best case against physicalism[3] yet devised.

1. https://hackage.haskell.org/package/exotic-list-monads-1.1.0...

2. https://en.wikipedia.org/wiki/Knowledge_argument

3. https://en.wikipedia.org/wiki/Physicalism

replies(1): >>44448139 #
1. zzo38computer ◴[] No.44448139[source]
Although there can be other monads (and stuff other than monads, such as ZipList) that can be made with lists, I think that such a monad would not necessarily be a "list monad". (Your link [1] has several examples of this.) You are right that it does not mean that "a list is a monad" and that your other phrasing is better, but it does not mean that "there isn't a list monad".
replies(1): >>44448430 #
2. kelseyfrog ◴[] No.44448430[source]
To me "a list monad" often subtly implies "one" list monad. I wasn't very clear, but the point I was trying to make was more along the line of singular vs plural. Thanks for pointing out the discrepancy.