
On Sun, Dec 05, 2021 at 02:39:01PM +0000, Adrian wrote:
On Sunday, December 5th, 2021 at 8:13 AM, Tom Ellis
wrote: On Sun, Dec 05, 2021 at 02:02:09PM +0000, Adrian via Haskell-Cafe wrote:
In the Data.Monoid library there is a monoid type instance for Endo a that is described in the following manner: > The monoid of endomorphisms under composition. I understand how it is a monoid of endofunctions, but am unclear on how it is a monoid of endomorphisms.
I'm not sure what you mean. The morphisms in this case are exactly functions. "Endomorphism" and "endofunction" have the same meaning in this context.
According to Algebra [Hungerford 74], an endomorphism is an endofunction that is a homomorphism. A set of endomorphisms is quite distinct from a set of endofunctions in this regard.
The "endomorphism" terminology in use in this case comes from category theory rather than algebra narrowly:
An endomorphism of an object x in a category C is a morphism f: x → x
https://ncatlab.org/nlab/show/endomorphism In the case of the Endo documentation, the category under consideration is Hask, the category whose objects are Haskell types and whose morphisms are Haskell functions. Therefore "endofunction" and "endomorphism" refer to the same thing in this context.