I've got some code where a user can provide a filter to subscribe to a particular type of event. The events come in as xml and are parsed using the toEvent method.
The code works fine but is repetitive since each event record potentially has the information needed to parse the xml using the field names and types.
So is there a way to get rid of the repetition and streamline the code? Should I be using TH or lenses or something else entirely?