[Haskell-cafe] Contravariance

Johan Glimming glimming at kth.se
Tue Feb 8 14:06:25 EST 2005


I have a problem with contravariance in the bananas in space setting. 
If you take catamorphism from a function space such as A=A->A to a type 
such as BxC, then the negative occurrence of X in the functor GXY=X->Y 
swaps around BxC into B+C.

This means that maybe in this particular case  Meijer-Hutton's original 
Haskell code for cata/ana does not work, since the type for cata would 
force BxC and B+C to be the same type.

I might be wrong about this, and I wonder anybody can comment on this.

Med vänliga hälsningar / Yours Sincerely,
Johan Glimming

More information about the Haskell-Cafe mailing list