This is untested, but it seemed there were some common patterns in the Event functions. I'm not entirely sure that mapE or mapMS are the best names (mapE is mapping the contents of the signals of an Event, and mapMS is a mapM on the signals). Also, this patch doesn't export the functions.
Event: add mapE, mapMS
Event: list LANGUAGE pragmas one per line
Event: remove unused MultiParamTypeClasses
Removing this gave no error, though perhaps it is
implied by FunctionalDependencies.
Event: add mapMD, liftD
Use these to simplify some Discrete functions.