nwould normally be handled by an imperative language, C:
n, updating the stored value of the
sumvariable on each iteration. In the case of
n = 3:
[n .. m]– which produces a list of numbers from
[1..3] => [1, 2, 3]
sum– which produces the sum of a list
=in Haskell is not the assignment operator as in imperative languages, but the equivalent of the mathematical equal sign.