Strongly typed events in Haskell
问题 I'm working on my first 'real' Haskell project, and simultaneously trying to get my head around event sourcing. (It seemed like a good match; event sourcing is a rather functional way of looking at data.) I've hit a wall trying to figure out how to deserialise my events into strongly typed Haskell data. There are two opposing forces at work here: It shouldn't be possible to apply an event to the wrong type of aggregate. This requirement suggests that I need a separate type of event for each