Sorry for the french, I was a little bit confused...
On 08/02/08, Chaddaï Fouché wrote :
After I changed John's code so that it worked on the same dataset as mine, I
could benchmark both of them :
My solution is a bit faster (but that's a very tiny difference and to be
expected since John's fold are more general than mine), but in any case,
both solution are reasonably fast (2s on a 10M Double array (unboxed)) and
don't eat any more memory than necessary :
Anyway it would be nice to have some version of those function in the
standard library (MArray) since they are pretty useful and efficient. I
don't use functional language in order to have to code explicit loops on my
data structures !! ;-)
(And as we saw, to write an efficient generalisation of those loops isn't as
easy as it might seems)
--
Jedaï