[Haskell-cafe] Comments from OCaml Hacker Brian Hurt
miguelimo38 at yandex.ru
Thu Jan 15 17:24:03 EST 2009
On 16 Jan 2009, at 01:10, Dan Weston wrote:
> Maybe you can explain that again?
Consider the following setting: a category C and a bifunctor T : C x C
-> C, which is associative and have a (left and right) unit I. This is
what is called "monoidal category".
A "monoid" is an object X in C with two morphisms: I -> X and T(X, X) -
> X, satisfying two relatively simple conditions (I don't want to
draw commutative diagrams).
If your category is a category of sets, and T is a cartesian product,
then you have ordinary monoids (I is a one-element set, first morphism
is a unit of a monoid, and second morphism is monoid multiplication).
If, however, you category is a category of endofunctors of some
category D (that is, functors D -> D), and T is composition, then our
"monoids" become monads on D: I is an identity functor, first morphism
is "return", and second one is "join".
> I see how the subset of Kleisli arrows (a -> m a) forms a monoid (a,
> return . id, >>=), but what to do with (a -> m b)? (>>=) is not
> closed under this larger set.
> Miguel Mitrofanov wrote:
>>> Notice that "monoid" sounds almost *exactly* like "monad". And
>>> yet, what you use them for is wildly unrelated.
>> Well, monads are monoids. I remember explaining you that...
>> Haskell-Cafe mailing list
>> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe