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

Edward Kmett ekmett at gmail.com
Wed Jul 8 15:15:06 EDT 2009


Yeah, it would probably have to have a new name because it does have a
different kind than the existing Endo. GEndo was the best I could come up
with that didn't sound verbose (GeneralizedEndo, CategoricalEndo) or like it
was naming the wrong thing (EndoCategory). I'm not wedded to the name by any
means.

Note: a type synonym,

> type Endo = GEndo (->)

like you mentioned would work, but has the downside that it may require
clients that provided instances for Endo to add TypeSynonymInstances where
they previously hadn't and I'm not sure how folks would feel about that.

-Edward Kmett

On Wed, Jul 8, 2009 at 2:05 PM, <roconnor at theorem.ca> wrote:

> 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 haskell.org
>> http://www.haskell.org/mailman/listinfo/libraries
>>
>>
>>
>>
>>
> --
> Russell O'Connor                                      <http://r6.ca/>
> ``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.''
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/libraries/attachments/20090708/29cbd498/attachment.html


More information about the Libraries mailing list