Ticket #51 (new enhancement)
optimization of fst . unzip . zip
|Reported by:||choener||Owned by:|
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.