
4 Jun
2008
4 Jun
'08
5:49 a.m.
Henning Thielemann
Now the difficult question: How to write the 'mean' function in terms of 'sum' and 'length' while getting the same performance?
Write a RULE pragma converting \xs -> (foldl' f y0 xs,foldl' g z0 xs) into \xs -> foldl' (\(y,z) x -> (f y x,g z x)) (y0,z0) xs ? To actually work, it'd have to work for arbitrary top level function, not just the (,) constructor. No idea if it's feasible at all, of course :-) -k -- If I haven't seen further, it is by standing in the footprints of giants