Rule 163e-dec-just
Decoding
(163)
Comments
The side condition makes always decode as Nothing, at once, by rule (162): in Maybe (Maybe Int) it decodes as the outer Nothing, and Just Nothing is never the result of decoding. A value other than that does not decode at does not decode at Maybe either.
TeX source
\defnrule[r:e-dec-just]
{j\neq\effnull\premsep\Dec{\tau}(j)=v}
{\Dec{\tau\,\tMaybe}(j)=\kw{Just}\ v}Tests (4)
- elm / MinimalPipeJustTestA pipe at `Maybe Int`: the value the driver sends in comes back out.
- elm / PortEchoMaybeIntTestA `Maybe Int` sent out through a port comes back unchanged through an incoming port, for each of three sample values.
- elm / PortEchoNestedTestA `List (Maybe ( Int, List String ))` sent out through a port comes back unchanged through an incoming port, for each of two sample values.
- elm / PortPipeMaybeTestJSON `null` and other values received at `Maybe` types 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-just] 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.