News for hackers. Stuff that matters.
Re:A 2020 Vision of Linear Algebra by cbm-vic-20 on Tuesday May 12, 2020 @09:26AM (#23153716)
"A monad is just a monoid in the category of endofunctors, what's the problem?"
Re:A 2020 Vision of Linear Algebra by Koshkin on Tuesday May 12, 2020 @11:00AM (#23154706)
I don't think this definition is correct. (A monad is an endofunctor.)
Re:A 2020 Vision of Linear Algebra by crdrost on Tuesday May 12, 2020 @12:23PM (#23155828)
It's correct but jargony. So in the category of sets there is a notion of product between two sets called the Cartesian product, and one can do a couple things to endow this product with an identity element, for example one might use {{}} as that object in the category of sets.

The claim is that in other categories, there might be other natural combinations between two objects, for example a tensor product of Abelian groups combined with the integers Z as unit, or a composition of two endofunctors into a new endofunctor F ∘ F combined with the identity functor.

So the idea is that a monoid is somehow a destroyer of this combination operation; a monoid in sets un-combines the Cartesian product M × M back into the set M, and indeed this is a function (a set-arrow) from the combined objects to the underlying object.

By having an endofunctor combined with a natural transformation from F ∘ F back to F (natural transformations are the arrows in the category of endofunctors) a monad is therefore doing exactly what a monoid does, if you replace the "pre-monoid" combination step of the Cartesian product with instead a new "pre-monoid" combination step of endofunctor composition.

Re:A 2020 Vision of Linear Algebra by howling on Tuesday May 12, 2020 @11:43AM (#23155210)
The definition is correct. A monad is an endofunctor with return and join functions. Just like a monoid in the category of sets is a set with identity and multiplication.