[Haskell-beginners] Simple Moving Average of a list of real numbers

Patrick Redmond plredmond at gmail.com
Tue Nov 26 04:31:22 UTC 2013


In functional programming, loops are implemented using recursion and tailcalls.
You have the power of loops beyond what "for" and "while" can express.

On Tuesday, November 26, 2013, Alexandr M wrote:

> Hello !
>
> Could anybody explain me how to calculate simple moving average of a list ?
>
> I have found several examples in internet but I completely don't
> understand how it works.
>
> Basically it's necessary to iterate over the list of real numbers and
> calculate average values over last n items in the list.
>
> I just can't imagine how to do it without loops.
>
> --
> Best regards,
> Alex
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20131126/ea22c2e6/attachment.html>


More information about the Beginners mailing list