simonpj     2004/12/06 02:58:08 PST

  Modified files:
    ghc/compiler/specialise Specialise.lhs 
  Log:
        ---------------------
        Bug in specialisation
        ---------------------
  
  Laszlo managed to get a function like this:
  
        foo :: Enum a => (# a, Int #)
  
  The specialiser specialised it, resulting in an unboxed tuple
  binding, which Lint objected to.
  
  This commit adds a dummy argument to the specialised function, 
  very like the case for strictness analysis.  For example, at
  type Char we'd get
  
        foo_char :: State# RealWorld -> (# Char, Int #)
        foo_char = \_ -> ...
  
  We use a State# type because it generates no argument-passing code 
  at runtime.  (We should really have some other void type for this 
  purpose, because State# is misleading, but this way avoids extra
  types.)
  
  
  
  Revision  Changes    Path
  1.90      +11 -5     fptools/ghc/compiler/specialise/Specialise.lhs
_______________________________________________
Cvs-ghc mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to