Elm Exactly

Rule 161e-dec-unit

DecodingDecτ(j)=v\Dec{\tau}(j)=v
Dec()(null)=()\frac{\begin{array}{c}\end{array}}{\begin{array}{c}\Dec{\tunit}(\effnull)=()\end{array}}
(161)
Read it in its chapter·Permanent address: /standard/rules/e-dec-unit

Comments

At an incoming port, the unit type accepts null\effnull and nothing else. The flags of a program are decoded otherwise when their type is the unit type (Chapter 9).

TeX source
\defnrule[r:e-dec-unit]
  {}
  {\Dec{\tunit}(\effnull)=()}

Tests (3)

  • elm / MinimalPipeUnitTest
    A pipe at `()`: the value the driver sends in comes back out.
  • elm / PortEchoUnitTest
    A `()` sent out through an outgoing port comes back unchanged through an incoming port.
  • elm / PortPipeScalarsTest
    JSON numbers, Booleans, strings and `null` received at `Float`, `Int`, `Bool`, `String` and `()` go out as they came.

Discussions

Discuss this rule·Search the discussions on GitHub

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