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.

Attachment: signature.asc
Description: OpenPGP digital signature

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to