id,summary,reporter,owner,description,type,status,priority,milestone,version,resolution,keywords,cc
51,optimization of fst . unzip . zip,choener,,"Hi,

lets assume this:
{{{
f n = map (\(a,b) -> (a+1,b+1)) . zip (enumFromN 0 n) (enumFromN 0 n)
g = fst . unzip

main = print . sum . g . f $ 100
}}}

In this case i would like to have {{{sum . g . f}}} reduce to {{{sum . enumFromN 0}}} but this does not happen. Is it in any way possible to get the optimizer to ""cut out"" unused code paths? The map operation in ""f n"" is basically a placeholder for something complicated.

If this is possible to optimize correctly, it becomes possible to nicely describe some complicated code paths.",enhancement,new,major,,0.7,,code-path optimization,choener@…
