ML
fun State.reduce(msg: Msg): StateUpdate {
val subState1 = this.subState1.reduce(msg)
val subState2 = this.subState2.reduce(msg)
return StateUpdate(
state = this.copy(
subState1 = subState1.state,
subState2 = subState2.state,
counter = this.counter++
),
cmds = subState1.cmds + subState.cmds + Cmd.Kek()
)
}