Elm Exactly

Rule 127dm-topdec-port-out

Top-level DeclarationsE⊢topdec⇒I\jdg{E}{\topdec}{I}
E⊢port var : (out,τ)⇒{var↦outport(var,τ)} in Interface\frac{\begin{array}{c}\end{array}}{\begin{array}{c}\jdg{E}{\kw{port}\ \var\ \kw{:}\ (\smdirout,\tau)} {\{\var\mapsto\effoutport(\var,\tau)\}\ \text{in}\ \Interface}\end{array}}
(127)
Read it in its chapter·Permanent address: /standard/rules/dm-topdec-port-out

Comments

Rules (127) and (128): the payload type τ\tau comes from elaboration through the reduced syntax; it has no type variables, so the value of a port is the same at every use. Applied to a value, the value of an outgoing port gives a command that sends its encoding at τ\tau; applied to a function, the value of an incoming port gives a subscription (Section 8.7). Port names are unique in a program, so the name identifies the port.

TeX source
\defnrule[r:dm-topdec-port-out]
  {}
  {\jdg{E}{\kw{port}\ \var\ \kw{:}\ (\smdirout,\tau)}
     {\{\var\mapsto\effoutport(\var,\tau)\}\ \text{in}\ \Interface}}

Tests (1)

Discussions

Discuss this rule·Search the discussions on GitHub

Discussions are on GitHub; one about this rule has [r:dm-topdec-port-out] 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.