News for hackers. Stuff that matters.
Re:Tom, Dick & Harry by atto on Wednesday February 06, 2013 @09:57PM (#5180231)
Sure. However, it does represent problems I've seen before with "overly" (subject to the person, I guess) complex solutions that end up being significantly less efficient. In this case, the problem is actually the `.toSet`, which forces a second iteration of the dataset. If the Monoid class was rewritten (yes, to be less mathematically pure) to use Seqs, it's nearly identical performance (as expected) as the linear solution.

Fun performance graph: http://i.imgur.com/2rOvb6V.png

Re:Tom, Dick & Harry by greendestiny on Wednesday February 06, 2013 @10:34PM (#5180366)
That is interesting. Personally I didn't find framing the original problem as monoid enlightening at all, but that's what I thought the author was getting at.