Adding a newtype EndoCategory to Control.Category (ticket #3362)

roconnor at roconnor at
Wed Jul 8 14:05:52 EDT 2009

On Wed, 8 Jul 2009, Edward Kmett wrote:

> +1 in favor of generalizing Endo in Data.Monoid.
> In my monoids library I have a Data.Monoid.Categorical that includes a 'GEndo' generalized endomorphism
> over an arbitrary category and I would love to be able to remove it.
> -Edward Kmett

I was looking for this in your lib, but I didn't find it.

Anyhow, I'm also in favour of generalizing Endo.  I was being conservitive 
with my initial proposal.

Would we still have to pick a new name and then

type Endo a = NewEndoName (->) a


> In Data.Monoid there is
>  newtype Endo a = Endo { appEndo :: a -> a }
>  instance Monoid (Endo a) where
>        mempty = Endo id
>        Endo f `mappend` Endo g = Endo (f . g)
> and (->) is an instance of Category, so perhaps we should generalize Endo.
> The name EndoCategory seems wrong, as this won't be an instance of Category.
> Endomorphism?
> _______________________________________________
> Libraries mailing list
> Libraries at

Russell O'Connor                                      <>
``All talk about `theft,''' the general counsel of the American Graphophone
Company wrote, ``is the merest claptrap, for there exists no property in
ideas musical, literary or artistic, except as defined by statute.''

More information about the Libraries mailing list