←back to thread

A list is a monad

(alexyorke.github.io)
153 points polygot | 4 comments | | HN request time: 0.617s | source
1. revskill ◴[] No.44445883[source]
U must prove it is a monoid in the category of endofuncors.
replies(2): >>44446065 #>>44447702 #
2. rebeccaskinner ◴[] No.44446065[source]
join has the type `m (m a) -> m a`. That's the thing that really shows off the monoidal structure. People normally implement monads in terms of bind, but you can easily define join in terms of bind for any Monad: `join ma = ma >>= id`. So really, as long as you have a lawful instance of Monad written with bind the existence of join is your proof.
3. hirvi74 ◴[] No.44447702[source]
> monoid in the category of endofuncors.

I do not even know what a monoid or an endofuncor is. While I enjoy math, despite not being the best at it, I am confident I never made it this far in my studies. I looked at the Wikipedia definitions, and I am even more confused now.

replies(1): >>44448562 #
4. 1-more ◴[] No.44448562[source]
https://bartoszmilewski.com/2016/12/27/monads-categorically/

This is a book chapter, and you need the preceding chapters to grasp it I think. I'm still in the middle of it.