handler :: Event -> Model -> State -> IO State
handler event model state = case event of
  NoEvent         -> return state
  VideoExpose     -> redraw model state >> return state
  VideoResize x y -> setView x y >> return state
  event -> case nextState event state of
    Nothing -> return state
    Just state -> redraw model state >> return state
handler :: Event -> Model -> State -> IO State
handler event model state = case event of
  NoEvent         -> return state
  VideoExpose     -> redraw model state >> return state
  VideoResize x y -> setView x y >> return state
  event -> case nextState event state of
    Nothing -> return state
    Just state -> redraw model state >> return state
handler event model state = case event of
  NoEvent         -> return state
  VideoExpose     -> redraw model state >> return state
  VideoResize x y -> setView x y >> return state
  event -> case nextState event state of
    Nothing -> return state
    Just state -> redraw model state >> return state