Optimizations done by typechecker and desugarer

Brian Alliet brian at brianweb.net
Tue Apr 3 16:52:41 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...

Just curious.

-Brian



More information about the Cvs-ghc mailing list