Currently, we have
addEventListener :: forall eff. EventType
-> EventListener (dom :: DOM | eff)
-> Boolean
-> EventTarget
-> Eff (dom :: DOM | eff) Unit
where EventListener (dom :: DOM | eff) is basically a function Event -> Eff eff a (why not Eff eff Unit?).
In order to add support for KeyboardEvent, MouseEvent, .., we would need a way to add event listeners of the form KeyboardEvent -> _ instead of Event -> _. Otherwise, there would only be unsafe ways to convert Event to KeyboardEvent within the listener (?). That's certainly not a good design choice.
So how can this be fixed on the type level? Is it useful to annotate EventType with the type of the event? (sounds weird, but currently, EventType is just a string indicating the sort/kind/type of event). I would be happy to implement support for keyboard and mouse events, but I don't have the experience to choose the best way to proceed here...