4 ms·
> Then you're able to conclude that `a` is a monoid Yep, which is why I'm saying all the interesting bits come from `a` being the monoid in that example. In t
by spion 4y ago
> Then you're able to conclude that `a` is a monoid
Yep, which is why I'm saying all the interesting bits come from `a` being the monoid in that example.
In the free monad interpreter example, I have no idea though.
- kmill 4y agoIf there's a point to any of this, I think it's monads let you package up some algebraic structure in the form of a function `m a -> a` that satisfies certain properties, and then you can pass such a function around without any reference to the fact that `a` implements that algebraic structure. This function is the interface. (Is there real practical significance? I'm not sure, but I'm not trying to argue that :-) ) > all the interesting bits come from `a` being the monoid in that example. Yeah, there's nothing deep there. I just said what I said to underscore that the converse is true, that if anyone were to hand you such a `list a -> a` function then it's encoding some monoid structure on `a` (one of often very many).