[Haskell-cafe] Mapping over multiple values of a list at once?
miguelimo38 at yandex.ru
Thu Aug 27 04:22:10 EDT 2009
transpose & tails, I guess.
haskell at kudling.de wrote:
> 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
> you need to find the averages of
> 4,3,2 and 3,2,6 and 2,6,7
> resulting in
> What is the most elegant way to do that?
> The naive ansatz to use "(!!") excessively sounds pretty inefficient.
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
More information about the Haskell-Cafe