Rule 191p-in-reject
Transitions
(191)
Comments
A boundary value that does not decode at the type of the port is rejected: the program never sees it, and is unchanged. Thus with port recv : (String -> msg) -> Sub msg, the value 1337 is rejected. For every incoming port and every boundary value one of rules (190) and (191) applies, so the host may send at any time. A name that is not an incoming port of the program has no transition: sending on it is outside the definition.
TeX source
\defnrule[r:p-in-reject]
{\PE(\effp)=(\smdirin,\tau)\premsep\Dec{\tau}(j)\ \text{is undefined}}
{K\step{\pgEvIn(\effp,j)}K}Tests (4)
- elm / PortIncomingRejectTestA value that does not decode at an incoming port's type is rejected, and the program goes on.
- elm / PortPipeBytesRejectTestA JSON value sent to a `Bytes` port is rejected, whatever it holds.
- elm / PortPipeRejectTestValues that do not decode at an incoming port's type are rejected, and the program goes on.
- elm / PortPipeValueRejectsBytesTestA byte sequence sent to a `Json.Encode.Value` port is rejected, alone or inside an object.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:p-in-reject] 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.