Elm Exactly

Rule 133e-task-andthen-succeed

Task Reductiontk→⟨a⟩tk′\tk\effred{\opt{\effa}}\tk'
⊢v v′⇒tkandThen(v,succeed v′)→tk\frac{\begin{array}{c}\japp{v}{v'}{\tk}\end{array}}{\begin{array}{c}\effandThen(v,\effsucceed\,v')\effred{}\tk\end{array}}
(133)
Read it in its chapter·Permanent address: /standard/rules/e-task-andthen-succeed

Comments

The task tk\tk to which vv applied to v′v' evaluates is not reduced by this step; it is the task the process performs next. If the application has no result (for instance, it reaches Debug.todo), the task has no reduction, and the process never ends.

Referred to from

TeX source
\defnrule[r:e-task-andthen-succeed]
  {\japp{v}{v'}{\tk}}
  {\effandThen(v,\effsucceed\,v')\effred{}\tk}

Tests (3)

  • elm / MinimalTaskAndThenTest
    A task chained after a task that succeeds.
  • elm-core / CoreIssue955KillProcessTwiceTest
    Killing a process that has already finished, a second time, throws a JavaScript error.
  • elm-core / TaskOnErrorCascadeTest
    `Task.onError` recovers a failed `Task.andThen` chain, skipping the steps between the failure and the handler, and the recovered task can be chained further.

Discussions

Discuss this rule·Search the discussions on GitHub

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