prev (16) slide 17 / 33 next (18)
Ui.State, Ui.Diff, Ui.Sync
Ui.Diff
diff :: State.State → State.State → Either DiffError [Update.Update]
Ui.Update
data Update
= ViewUpdate ViewId ViewUpdate
| BlockUpdate BlockId BlockUpdate
...
data ViewUpdate =
CreateView
| DestroyView
| ViewSize Types.Rect
...
sort :: [Update] → [Update]
Ui.Sync
sync :: State.State → [Update.Update] → BlockSamples →
IO (Maybe State.StateError)
do_updates :: BlockSamples → [Update.Update] → State.StateT IO ()
do_updates block_samples updates = do
actions <- mapM (run_update block_samples) updates
-- Trans.liftIO $ putStrLn ("run updates: " ++ show updates)
Trans.liftIO (Ui.send_action (sequence_ actions))
run_update :: BlockSamples → Update.Update → State.StateT IO (IO ())
- Diff is nasty icky code.
- Update track region hack.
- But printing Updates is useful for debugging.
- Since I hardly ever change the GUI now, I can live with this.
prev (16) slide 17 / 33 next (18)