Elm Exactly

Rule 137e-task-andthen-inner

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

Comments

Rules (137) and (138) carry both silent and labelled steps out of the task that is performed first. Every step of a process is a separate reduction, and another process may take steps between any two of them: a process may be suspended at any andThen\effandThen, and the definition guarantees no more. In particular, a program cannot rely on a process running without interruption until it reaches a primitive.

TeX source
\defnrule[r:e-task-andthen-inner]
  {\tk\effred{\opt{\effa}}\tk'}
  {\effandThen(v,\tk)\effred{\opt{\effa}}\effandThen(v,\tk')}

Tests (3)

  • elm / MinimalTaskAndThenInnerTest
    A chained task whose first task takes steps of its own.
  • 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.
  • elm-core / TaskOnErrorInnerTest
    `Task.onError` lets its task take steps before it succeeds or fails.

Discussions

Discuss this rule·Search the discussions on GitHub

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