[Hs-Generics] patch applied (generics): Simplification of representation of arity two

Alexey Rodriguez Yakushev alexey at cs.uu.nl
Tue Feb 12 06:31:24 EST 2008


Tue Feb 12 03:25:04 PST 2008  Alexey Rodriguez <alexey at cs.uu.nl>
  * Simplification of representation of arity two
  
  Previously the arity two representation was
  |data Rep2 f a b c d = ...| where |c| and |c|
  represented the non-generic variables (for
  example for the two variables used in crushRight:
  |Rep2 CrushRight a b c d| and
  |newtype CrushRight  c b a x = CrushRight { crushRight :: (c -> b -> b) -> b -> a -> b }
  ).
  It turns out that |Rep2| does not need the additional c and d,
  we do the same thing that the EMGM version of the test was doing:
  > data Rep2 f a b = ...
  > newtype CrushRight c b a x = CrushRight { crushRight :: (c -> b -> b) -> b -> a -> b }
  so it is represented as |Rep2 (CrushRight c d) a b|.
  

    M ./comparison/LIGD/BinTreeReps.hs -1 +1
    M ./comparison/LIGD/CrushRight.lhs -5 +4
    M ./comparison/LIGD/GMap.lhs -6 +4
    M ./comparison/LIGD/LIGD.lhs -27 +27
    M ./comparison/LIGD/TreeReps.hs -1 +1


More information about the Generics mailing list