On Wed, 19 Apr 2000, Jan-Willem Maessen wrote:
> I agree so wholeheartedly that I just write a (very!) short paper on
> the subject for ICFP (having discovered to my surprise that no such
> write-up existed). It describes how to identify such expressions and
> hoist them out so they don't end up getting inlined. It's still being
> refereed is thus likely to be revised, but if you're interested in a
> pre-print take a look (there are no pointers to it from elsewhere at
> the moment):
>
It's interesting reading. However, it seems to me that it would interact
badly with minimal typing derivations (mtd). Mtd is an algorithm for type
checking which computes the least general type instead of the most
general. This is used by some compilers to guide other optimisations. Some
optimisations, like certain representation analysises, do a better job on
less polymorphic code and therefore it is desirable to have less general
types.
Does ghc use mtd or some other heuristics to remove redundant
polymorphism?
/Josef
PS. Sorry for not having any pointers to mtd.