Fork me on GitHub
Chris O’Donnell00:08:06

In my opinion, the best solution just uses reduce. Your accumulator would be a map keyed by chat-id with values being a sorted-map storing messages, keyed by timestamp.


Ok yes that is what I am doing as well :)


It was just out of curiosity, is it because of the oldest timestamp? In general, just for learning, can I carry a counter while I navigate the data with specter?

Chris O’Donnell00:08:18

I can't think of a great way to do it using specter. I think specter is better for selecting from or transforming pieces of a nested data structure individually, while your task is aggregating all of your structure into something new. Maybe @nathanmarz has more insight.


@nathanmarz: FYI this was needed for fixing my earlier issue (after upgrading to 0.12):


@darwin do you have a full stack trace from when the error was happening?