Elm Exactly

Rule 183p-update

TransitionsK→⟨ℓ⟩K′K\step{\opt{\ell}}K'
⊢r(update) v1⇒v2⊢v2 v⇒(v′,cm)Flat(cm)={ ⁣∣ c1,…,cn ∣ ⁣}s,P,Q,H⊢c1⋯cn⇒(P′,Q′,H′)⊢r(subscriptions) v′⇒sb′(s,v,v1⋅M,P,sb,Q,H)→(s,v′,M,P′,sb′,Q′,H′)\frac{\begin{array}{c}\japp{r(\kw{update})}{v_1}{v_2}\premsep\japp{v_2}{v}{(v',\cm)}\\ \effFlat(\cm)=\effmset{\effc_1,\ldots,\effc_n}\premsep \jdg{s,P,Q,H}{\effc_1\cdots\effc_n}{(P',Q',H')}\\ \japp{r(\kw{subscriptions})}{v'}{\sbv'}\end{array}}{\begin{array}{c}(s,v,v_1\cdot M,P,\sbv,Q,H)\step{}(s,v',M,P',\sbv',Q',H')\end{array}}
(183)
Read it in its chapter·Permanent address: /standard/rules/p-update

Comments

This is the only rule that takes a message from the queue or changes the model. The message at the head of the queue is applied, with the model, to update; the commands of the result are dispatched, and the subscriptions recomputed from the new model, whether or not it has changed, all in the one step. If the application of update has no result (it reaches Debug.todo), the rule never applies again, and no further message is handled, though processes, ports and the platform go on taking steps.

Referred to from

TeX source
\defnrule[r:p-update]
  {\japp{r(\kw{update})}{v_1}{v_2}\premsep\japp{v_2}{v}{(v',\cm)}\\
   \effFlat(\cm)=\effmset{\effc_1,\ldots,\effc_n}\premsep
   \jdg{s,P,Q,H}{\effc_1\cdots\effc_n}{(P',Q',H')}\\
   \japp{r(\kw{subscriptions})}{v'}{\sbv'}}
  {(s,v,v_1\cdot M,P,\sbv,Q,H)\step{}(s,v',M,P',\sbv',Q',H')}

Tests (5)

Discussions

Discuss this rule·Search the discussions on GitHub

Discussions are on GitHub; one about this rule has [r:p-update] in its title.

A Standard Definition of Elm? (Draft version 0.4) © Rupert Smith. The text is licensed under CC BY 4.0: share and adapt it freely, with credit and a link to the licence.