Proposal: Add Compositor class as superclass of Arrow

apfelmus apfelmus at quantentunnel.de
Fri Oct 19 04:30:14 EDT 2007


Twan van Laarhoven wrote:
> apfelmus wrote:
>>   class Cartesian cat where
>>      fst   :: cat (a,b) a
>>      snd   :: cat (a,b) b
>>      (&&&) :: cat c a -> cat c b -> cat c (a,b)
>>
>> with the conditions
>>
>>      fst . (f &&& g) = f
>>      snd . (f &&& g) = g
> 
> That is not correct, fst . (f &&& g) also has the side effects of g.

Well, your remark indeed shows that it'ss not correct in the sense that 
Arrows aren't cartesian categories, that's why I mumbled something about 
Freyd-categories. Scary details here

   http://cs.ioc.ee/~tarmo/monads-more/monads-more-3.pdf

but it can be stated a bit simpler, I guess.

Regards,
apfelmus



More information about the Libraries mailing list