This is function, that works correctly, but it seems to be too ugly.panel argument is never used for anything but pushing into refreshGamePanel,and it seems to be too much case statements. How can I cleanup this?runGameLoop :: Game -> Panel -> Curses GameResultrunGameLoop game panel  = if victory game then return Victory else      refreshGamePanel game panel >> render >> getPanelWindow panel >>=        flip getEvent (Just 1)        >>=        \ event' ->          case event' of              Nothing -> runGameLoop game panel              Just event -> case event of                EventSpecialKey (KeyFunction 2) -> return Restart                EventSpecialKey (KeyFunction 10) -> return Quit                EventSpecialKey key' -> case keyToDirection key' of                  Nothing -> runGameLoop game panel                  Just dir -> runGameLoop (makeMove game dir) panel                _ -> runGameLoop game panel
Haskell with too much case statements
haskell