adjunctions icon indicating copy to clipboard operation
adjunctions copied to clipboard

Add Semigroup and Monoid instances for Co

Open ChrisPenner opened this issue 8 years ago • 0 comments

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

ChrisPenner avatar Jul 26 '17 01:07 ChrisPenner