Elm Exactly

Rule 179p-disp-task

Dispatchs,P,Q,H⊢L⇒(P′,Q′,H′)\jdg{s,P,Q,H}{L}{(P',Q',H')}
c∈Leaf(task,tk)pid∉Dom Ps, P+{pid↦(tk,s,c)}, Q,H⊢L⇒(P′,Q′,H′)s,P,Q,H⊢c⋅L⇒(P′,Q′,H′)\frac{\begin{array}{c}\effc\in\pgLeaf(\effmtask,\tk)\premsep\pid\notin\Dom P\\ \jdg{s,\ P+\{\pid\mapsto(\tk,s,\effc)\},\ Q,H}{L}{(P',Q',H')}\end{array}}{\begin{array}{c}\jdg{s,P,Q,H}{\effc\cdot L}{(P',Q',H')}\end{array}}
(179)
Read it in its chapter·Permanent address: /standard/rules/p-disp-task

Comments

Each task leaf starts a process of its own, with an identifier that names no process started before, live or ended; a leaf that occurs twice in a command starts two processes, and performs its task twice. The process keeps the leaf as its origin, since the message it gives, when its task succeeds, comes from the leaf (rule (188)).

TeX source
\defnrule[r:p-disp-task]
  {\effc\in\pgLeaf(\effmtask,\tk)\premsep\pid\notin\Dom P\\
   \jdg{s,\ P+\{\pid\mapsto(\tk,s,\effc)\},\ Q,H}{L}{(P',Q',H')}}
  {\jdg{s,P,Q,H}{\effc\cdot L}{(P',Q',H')}}

Tests (4)

  • elm / MinimalTaskPerformTest
    The message of a performed task reaches update.
  • elm / OutgoingPortTuple3KeepsRunningTest
    A program that sends a 3-tuple through an outgoing port keeps running afterwards.
  • elm-core / TaskAttemptErrorTest
    `Task.attempt` delivers both outcomes to `update` in a `Platform.worker`: `Ok` with the value of a succeeding task and `Err` with the error of a failing one.
  • elm-core / TaskPerformValueTest
    `Task.perform` delivers the task's value to `update` in a `Platform.worker`, for messages that carry an `Int`, a negative `Int` or a `String`, and for a message built by a function that ignores the value.

Discussions

Discuss this rule·Search the discussions on GitHub

Discussions are on GitHub; one about this rule has [r:p-disp-task] 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.