[project @ 2004-12-06 10:58:06 by simonpj]
authorsimonpj <unknown>
Mon, 6 Dec 2004 10:58:06 +0000 (10:58 +0000)
committersimonpj <unknown>
Mon, 6 Dec 2004 10:58:06 +0000 (10:58 +0000)
commitbfb876458300aa8c691c3160136136f3d4ee3375
treeea2844578c1d3a4d21f2bd6eac629c6faf109b9a
parentf6f3819f37d73eeaaffa7bf45126ce73fb53e72b
[project @ 2004-12-06 10:58:06 by simonpj]
---------------------
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.)
ghc/compiler/specialise/Specialise.lhs