Rule 152e-enc-tuple
Encoding
(152)
TeX source
\defnrule[r:e-enc-tuple]
{\Enc{\tau_1}(v_1)=j_1\premsep\Enc{\tau_2}(v_2)=j_2\premsep
\opt{\Enc{\tau_3}(v_3)=j_3}\premsep k=2\opt{{}+1}}
{\Enc{(\tau_1,\tau_2\opt{,\tau_3})\,\tTuple{k}}((v_1,v_2\opt{,v_3}))
=\effJarr{j_1,j_2\opt{,j_3}}}Tests (8)
- 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 / 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 / PortPipeTupleTestA JSON array received at a tuple type goes out with as many elements as the tuple has.
- 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:e-enc-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.