patch applied (ghc-6.8/ghc): Fix Trac #2130: improve derived Ord for primmitive types

Ian Lynagh igloo at earth.li
Sun Mar 2 10:01:14 EST 2008


Thu Feb 28 04:11:06 PST 2008  simonpj at microsoft.com
  * Fix Trac #2130: improve derived Ord for primmitive types
  
  This patch does two things:
  
  * (Minor): in TcGenDeriv.careful_compare_Case, test for less-than before
    equality. This should reduce the number of dynamic tests, and also gives
    more scope for optimisation, since less-than tells us more than equality.
  
  * (More important): add special-case derived code for data types that are
    simple wrappers of primitive types. See 
  	Note [Comparision of primitive types]
    This fixes Trac 2130.
  
  However see also Trac #2132, which is not addressed here.
  

    M ./compiler/prelude/PrelNames.lhs +1
    M ./compiler/typecheck/TcGenDeriv.lhs -3 +59



More information about the Cvs-ghc mailing list