November 01, 2013
What I'm trying to explain is that reduce takes two arguments: the growing value and the current front. In your case, the current front is indeed a 2-tuple, but that's an unrelated issue.

You're trying to get:

reduce!( (firstElemOfPair, secondElemOfPair) => ...) (range)

to work, whereas reduce signature is:

reduce!( (onGoingValue, elem) => ...) (range)


November 02, 2013
On Friday, 1 November 2013 at 20:08:15 UTC, Philippe Sigaud wrote:
> What I'm trying to explain is that reduce takes two arguments: the growing
> value and the current front. In your case, the current front is indeed a
> 2-tuple, but that's an unrelated issue.
>
> You're trying to get:
>
> reduce!( (firstElemOfPair, secondElemOfPair) => ...) (range)
>
> to work, whereas reduce signature is:
>
> reduce!( (onGoingValue, elem) => ...) (range)

OK, NOW I understand what you were trying to point out. The
function has to take the running sum (in my case) as one of the
arguments.

Thanks for your patience.
1 2
Next ›   Last »