Parametrizing EventHandler using monad