[Haskell-cafe] Dead else branch does influence runtime?

Johannes Waldmann waldmann at imn.htwk-leipzig.de
Tue Jun 14 14:35:19 CEST 2011

Dear all, 

I am very puzzled by a program that contains
an "else" branch that is never executed, 
but still seems to slow down the program.
(When I replace it by "undefined", the resulting program runs much faster.)

I thought it may be a type issue (the type of the else branch
forces the type of the "then" branch to be more general,
thus some optimization might not fire) but the types of the branches
look identical. (They are generic, but the specializer should take
care of that.)

I am sure GHC headquarters will look at this when they find the time
but perhaps there's some additional knowledge on this mailing list
that might help.


More information about the Haskell-Cafe mailing list