timerCallback :: IORef Scene -> TimerCallback
timerCallback sceneRef = do
    scene <- get sceneRef
    when (isValidScene scene) $ do
        nextScene <- nextScene scene
        sceneRef $= nextScene
        postRedisplay Nothing
        addTimerCallback (delayForScene nextScene) (timerCallback sceneRef)
timerCallback :: IORef Scene -> TimerCallback
timerCallback sceneRef = do
    scene <- get sceneRef
    when (isValidScene scene) $ do
        nextScene <- nextScene scene
        sceneRef $= nextScene
        postRedisplay Nothing
        addTimerCallback (delayForScene nextScene) (timerCallback sceneRef)
timerCallback sceneRef = do
    scene <- get sceneRef
    when (isValidScene scene) $ do
        nextScene <- nextScene scene
        sceneRef $= nextScene
        postRedisplay Nothing
        addTimerCallback (delayForScene nextScene) (timerCallback sceneRef)