Rule 153e-enc-record
Encoding
(153)
Comments
The fields become the keys of an object, which has no order, so the order of fields is no part of what is sent.
TeX source
\defnrule[r:e-enc-record]
{\Dom r=\Dom\varrho\premsep j\in\effStr\finmap\BVal\premsep\Dom j=\Dom\varrho\\
\Enc{\varrho(\lab)}(r(\lab))=j(\lab)\ \text{for each}\ \lab\in\Dom\varrho}
{\Enc{\rec{\varrho}}(r)=j}Tests (3)
- elm / MinimalPipeRecordTestA pipe at `{ a : Int }`: the value the driver sends in comes back out.
- elm / PortAliasEchoTestAn outgoing port whose type is written through a type alias, `port echoOut : Out msg` with `type alias Out msg = Payload -> Cmd msg`, sends its record payload, and the record comes back unchanged through an incoming port.
- elm / PortPipeRecordTestA JSON object received at a record type goes out with exactly the record's fields.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:e-enc-record] 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.