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

roconnor at roconnor at
Tue Jul 7 23:33:25 EDT 2009

I suggest adding a wrapper to make (a x x) a Monoid for any Category a and 
type x. This would be added to Control.Category.

newtype EndoCategory a x = EndoCategory { runEndoCategory :: a x x }

instance (Category a) => Monoid (EndoCategory a x) where
   mempty = EndoCategory id
   mappend (EndoCategory f) (EndoCategory g) = EndoCategory (f . g)

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