maydwell at gmail.com
Thu Jul 4 03:19:34 CEST 2013
I'm wracking my brain trying to figure out a simple, reasonably general,
implementation for a category instance for pairs of categories.
So far I've looked at , which seems great, but doesn't use the built-in
category instance, and , which I'm just not sure about.
Ideally I'd like to be able to express something like -
instance (Category a, Category b) => Category (Product a b) where
id = Product id id
Product o1 o2 . Product i1 i2 = Product (o1 . i1) (o2 . i2)
However, it all falls apart when I actually try to define anything. Is this
possible? If not, why not?
As far as I can tell the issue boils down to not being able to translate
"Category i o" to "Product (Fst i) (Fst o) (Snd i) (Snd o)" without
breaking the kind expectation of the category instance.
Please help me, I'm having a bad brain day :-)
 - http://twanvl.nl/blog/haskell/categories-over-pairs-of-types
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe