There's the manageHook
which is called every time a new window is recognized by Xmonad.
Is there something similar for a window closing hook?
No, one does not exist.
However, you can use handleEventHook
listening for DestroyWindowEvent
events. (Note, by default, two DestroyWindowEvent
hooks are produced, one will have ev_window == ev_event, the other will have ev_event = the parent.)