diff options
| author | simonpj <unknown> | 1999-06-28 16:23:28 +0000 |
|---|---|---|
| committer | simonpj <unknown> | 1999-06-28 16:23:28 +0000 |
| commit | 960223bfc3fd1c2ac4608b837fb83f3bc6b5fd16 (patch) | |
| tree | 126460989881ffe3910df3c155f547bd940c9ba1 /ghc/compiler/codeGen | |
| parent | 9956bafe44c39e07dff0c569dedc5cef3b41dbc7 (diff) | |
| download | haskell-960223bfc3fd1c2ac4608b837fb83f3bc6b5fd16.tar.gz | |
[project @ 1999-06-28 16:23:28 by simonpj]
Fix lost specialisations. There were two problems
{-# SPECIALISE f :: Int -> Rational #-}
fromIntegral = fromInteger . toInteger
This generates
fromIntegral_spec = fromIntegral d
for some suitable dictionary d. But since fromIntegral is small,
it got inlined into fromIntegral_spec, thus losing the specialised
call (fromIntegral d) that was the whole raison d'etre of fromIntegral_spec.
Haskish solution: add an inlne pragma for the _spec things:
fromIntegral_spec = _inline_me (fromIntegral d)
Now we won't inline inside. But this showed up a related problem. The
typechecker tries to common up overloaded things, so it actually generates
m = fromIntegral d
fromIntegral_spec = _inline_me m
which is pretty stupid. Using tcSimplifyToDicts (instead of tcSimplify)
in TcBinds.tcSpecSigs fixes this.
Diffstat (limited to 'ghc/compiler/codeGen')
0 files changed, 0 insertions, 0 deletions
