Karya, built on 2023-08-29T07:47:28 (patch 7a412d5d6ba4968ca4155ef276a062ccdeb9109a)
Safe HaskellSafe-Inferred

Cmd.ResponderSync

Description

Subset of the responder that handles syncing from Ui.State to the UI.

Synopsis

Documentation

sync Source #

Arguments

:: Sync 
-> Ui.State

state before Cmd was run

-> Ui.State

current state

-> Cmd.State 
-> Update.UiDamage 
-> MVar.MVar Ui.State 
-> IO ([Update.UiUpdate], Ui.State)

Sync uses Update.DisplayUpdates, but the diff also produces UiUpdates, which are needed for incremental save and score damage.

Sync ui_to to the UI.

Returns both UI state and cmd state since verification may clean up the UI state, and this is where the undo history is stored in Cmd.State.