Optimizations done by typechecker and desugarer

Simon Peyton-Jones simonpj at microsoft.com
Wed Apr 4 03:42:14 EDT 2007


| 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

S



More information about the Cvs-ghc mailing list