Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

Safe HaskellNone

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.CmdUpdate] 
-> MVar.MVar Ui.State 
-> IO ([Update.UiUpdate], Ui.State, Cmd.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.