On Wednesday, 9 September 2015 at 07:59:57 UTC, Sebastiaan Koppe wrote:
What is going wrong is that the types aren't the same. That is, the type of the seed you supplied - `typeof(foobars)` - isn't the type that your function returns - `typeof(acc.filter!...)`.

Alright. So, `reduce` initial seed is an `array` while the output of `filter` is a `FilterResult`. I suppose it makes sense to realise it (`.array`) before passing to the next round.

I was under the impression that `reduce` understands `FilterResult` and realises it internally; it doesn't and I was wrong. Though I believe it would have been more intuitive if it did.

Thanks for the help.

`array()` fixes that, no idea why you need `idup()` though.

True --`idup` was not required.  My mistake.


Reply via email to