handleKeyInput :: IO (Maybe SDL.Event) -> (KeyDirection -> IO a) -> IO Bool
handleKeyInput stream keyHandler = do
    maybeEvent <- stream
    case maybeEvent of
        Nothing -> return False
        Just (SDL.QuitEvent _ _) -> return True
        Just (SDL.KeyboardEvent _ _ _ _ _ keysym) -> do
            _ <- keyHandler $ keymap keysym
            return False
        _ -> return False
handleKeyInput :: IO (Maybe SDL.Event) -> (KeyDirection -> IO a) -> IO Bool
handleKeyInput stream keyHandler = do
    maybeEvent <- stream
    case maybeEvent of
        Nothing -> return False
        Just (SDL.QuitEvent _ _) -> return True
        Just (SDL.KeyboardEvent _ _ _ _ _ keysym) -> do
            _ <- keyHandler $ keymap keysym
            return False
        _ -> return False
handleKeyInput stream keyHandler = do
    maybeEvent <- stream
    case maybeEvent of
        Nothing -> return False
        Just (SDL.QuitEvent _ _) -> return True
        Just (SDL.KeyboardEvent _ _ _ _ _ keysym) -> do
            _ <- keyHandler $ keymap keysym
            return False
        _ -> return False