ekmett / adjunctions

Simple adjunctions
http://hackage.haskell.org/package/adjunctions
Other
44 stars 27 forks source link

Add Semigroup and Monoid instances for Co #41

Open ChrisPenner opened 7 years ago

ChrisPenner commented 7 years ago

There's a sensible Monoid for (Representable f, Monoid a) => f a, To mappend two representables we simple mappend the value in each 'slot'. mempty is simply tabulate (const mempty).

I found this Monoid quite useful when using Representable for types of discrimination.

I've added this instance for the Co wrapper.

Let me know if there's anything else this would need, or if it's not in line with your ideas.

Thanks for everything you do Edward!

Cheers