
17 Apr
2009
17 Apr
'09
6:08 p.m.
I did something similar a while ago to solve a problem posted on StackOverflow: http://porg.es/blog/sorted-sums-of-a-sorted-list Henry Laxen generalized my code a little bit so you can pass in any monotonic function (see the comments). I'm not sure of the laziness properties of this, but it might be lazy enough... you may need to swap for a boxed array.