transpose & tails, I guess.
[email protected] wrote:
Hi,
Imagine you have a list with n-values. You are asked to iterate over the list
and calculate the average value of each 3 neighbouring values.
For example, starting from
[4,3,2,6,7]
you need to find the averages of
4,3,2 and 3,2,6 and 2,6,7
resulting in
[3,4,5]
What is the most elegant way to do that?
The naive ansatz to use "(!!") excessively sounds pretty inefficient.
Bye,
Lenny
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe