
27 May
2012
27 May
'12
8:04 a.m.
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