Hi guys, first of all I just want to let you know that I'm a functional programming learner, and I'd love to see how more experienced people approach this problem. I have to process a list of email events (email was sent, email was bounced, email was a soft bounce or email was reported), aggregate them by an email campaign ID and update the corresponding counters. The solution I came up with and the test it must satisfy can be seen in this gist https://gist.github.com/davidgf/c03baedee14a758c406a58de99ea277a, but I'm not really satisfied, because it feels that I'm iterating over the entire list too many times. Given that I come from an imperative style background, I can figure out a much uglier but also much more efficient solution for this, but I wanted to see some FPer's take on this.