Optimizations done by typechecker and desugarer
Simon Marlow
simonmarhaskell at gmail.com
Wed Apr 4 06:38:38 EDT 2007
Simon Peyton-Jones wrote:
> | I noticed that the typechecker and desugarer try to do some minor
> | optimizations here and there. The handling of overloaded literals
> | recently caught my attention (see shortCutIntLit in typecheck/Inst and
> | tidyNPat in deSugar/MatchLit).
> |
> | Are these just there as a hangover from before the simplifier was as
> | smart as it is now? I tried taking them out and while the desugared
> | output ends up looking pretty scary the simplifier just goes to town on
> | it and ends up with the exact same code as before. I suppose it
> | probably helps compile time performance a little to take care of these
> | early...
>
> Yes it's just a shortcut to eliminate unnecessary clutter; not strictly necessary
presumably it helps unoptimised compilation too, whereas the simplifier will
only achieve the same result when optimisation is on and the relevant dictionary
unfoldings are available.
Cheers,
Simon
More information about the Cvs-ghc
mailing list