Elm Exactly

Rule 150e-enc-list

EncodingEncτ(v)=j\Enc{\tau}(v)=j
Encτ(v1)=j1  ⋯  Encτ(vn)=jnEncτ List([v1,…,vn])=[j1,…,jn]\frac{\begin{array}{c}\Enc{\tau}(v_1)=j_1\ \ \cdots\ \ \Enc{\tau}(v_n)=j_n\end{array}}{\begin{array}{c}\Enc{\tau\,\tList}([v_1,\ldots,v_n])=\effJarr{j_1,\ldots,j_n}\end{array}}
(150)
Read it in its chapter·Permanent address: /standard/rules/e-enc-list
TeX source
\defnrule[r:e-enc-list]
  {\Enc{\tau}(v_1)=j_1\ \ \cdots\ \ \Enc{\tau}(v_n)=j_n}
  {\Enc{\tau\,\tList}([v_1,\ldots,v_n])=\effJarr{j_1,\ldots,j_n}}

Tests (4)

  • elm / MinimalPipeListTest
    A pipe at `List Int`: the value the driver sends in comes back out.
  • elm / PortEchoListIntTest
    A `List Int` sent out through a port comes back unchanged through an incoming port, for each of three sample values.
  • elm / PortEchoNestedTest
    A `List (Maybe ( Int, List String ))` sent out through a port comes back unchanged through an incoming port, for each of two sample values.
  • elm / PortPipeListArrayTest
    JSON arrays received at `List` and `Array` types go out as the same arrays.

Discussions

Discuss this rule·Search the discussions on GitHub

Discussions are on GitHub; one about this rule has [r:e-enc-list] 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.