Rule 166e-dec-tuple
Decoding
(166)
Comments
An array longer than the tuple is accepted, and its further elements are ignored; a shorter array does not decode.
TeX source
\defnrule[r:e-dec-tuple]
{n\geq k\premsep k=2\opt{{}+1}\\
\Dec{\tau_1}(j_1)=v_1\premsep\Dec{\tau_2}(j_2)=v_2\premsep
\opt{\Dec{\tau_3}(j_3)=v_3}}
{\Dec{(\tau_1,\tau_2\opt{,\tau_3})\,\tTuple{k}}(\effJarr{j_1,\ldots,j_n})
=(v_1,v_2\opt{,v_3})}Tests (5)
- elm / MinimalPipeTupleTestA pipe at `( Int, Int )`: the value the driver sends in comes back out.
- 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 / PortEchoTuple2TestA `( Int, String )` sent out through an outgoing port comes back unchanged through an incoming port.
- elm / PortEchoTuple3TestA `( Int, Float, Bool )` sent out through an outgoing port comes back unchanged through an incoming port.
- elm / PortPipeTupleTestA JSON array received at a tuple type goes out with as many elements as the tuple has.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:e-dec-tuple] 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.