Elm Exactly

Rule 171e-msg-map

Messages⊢c◃x⇒v\effrecv{\effc}{\effx}{v}
⊢cm/sb◃x⇒v′⊢v v′⇒v′′⊢map(v,cm/sb)◃x⇒v′′\frac{\begin{array}{c}\effrecv{\cm/\sbv}{\effx}{v'}\premsep\japp{v}{v'}{v''}\end{array}}{\begin{array}{c}\effrecv{\effmap(v,\cm/\sbv)}{\effx}{v''}\end{array}}
(171)
Read it in its chapter·Permanent address: /standard/rules/e-msg-map

Comments

The innermost function is applied first. There is no rule for a leaf of an outgoing port: such a leaf gives no message, and the functions of the map\effmaps around it are never applied. The messages that the leaves of the managers of the platform give are defined by the platform.

TeX source
\defnrule[r:e-msg-map]
  {\effrecv{\cm/\sbv}{\effx}{v'}\premsep\japp{v}{v'}{v''}}
  {\effrecv{\effmap(v,\cm/\sbv)}{\effx}{v''}}

Tests (2)

  • elm / MinimalCmdMapTest
    A command mapped by a function gives the mapped message.
  • elm-core / CmdMapComposeTest
    `Cmd.map` applies its functions to a command's message, the innermost first.

Discussions

Discuss this rule·Search the discussions on GitHub

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