wondering about -ddump-parsed, rn

Isaac Dupree isaacdupree at charter.net
Sat Aug 11 12:16:51 EDT 2007


Also SPECIALIZE is turned into SPECIALIZE NOINLINE -- which has an 
effect on error messages too (which might be considered a bug).

And instances look very weird....

source:
instance Class.Eq Integer where
   CInteger a == CInteger b = a == b

ghc-6.6.1 -ddump-parsed:
instance {Class.Eq Integer} where
     []
     { == CInteger a CInteger b = a == b }

most recent HEAD -ddump-parsed:
instance Class.Eq Integer where
     []
     []
     { == CInteger a CInteger b = a == b }

Except for the two extra "[]" and the three necessary missing pairs of 
parentheses (or else using "==" in an infix position), this looks like 
valid Haskell

And then my Num instance becomes (in HEAD)

instance Class.Num Integer where
     []
     []
     { + CInteger a CInteger b = mkInteger (addInteger a b)
       * CInteger a CInteger b = mkInteger (multiplyInteger a b)
       negate (CInteger a) = mkInteger (negateInteger a)
       abs (CInteger a) = mkInteger (absInteger a)
       signum (CInteger a) = mkInteger (signumInteger a)
       fromInteger unboundedIntegral
                     = mkInteger (uncheckedFromIntegral unboundedIntegral) }

, which uses curly braces but not semicolons, so the layout wouldn't 
work in Haskell, for multiple functions defined in the instance, too.


Isaac


More information about the Glasgow-haskell-users mailing list