
A lot of people have done this :) eg from me: google up a fairly recent thread from me about processing streams and perhaps the keyword "timeplot" (writing from a dying phone, can't do myself)
27.05.2012, в 12:04, Chris Wong
Hello all
I just came up with a way of executing multiple folds in a single pass. In short, we can write code like this:
average = foldLeft $ (/) <$> sumF <*> lengthF
and it will only traverse the input list once.
The code is at: https://gist.github.com/2802644
My question is: has anyone done this already? If not, I might release this on Hackage -- it seems quite useful.
Chris
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe