Figureeffects-port-table
| Elm type | Port? | Sent as (Enc) | Accepted (Dec) |
Int | yes | the number | a number that is an integer in |
Float | yes | the number; for NaN and the infinities | any number, rounded |
Bool | yes | or | or only |
String | yes | the string | a string only |
Bytes | yes | a byte sequence | a byte sequence only |
() | yes | only (flags: Chapter 9) | |
Maybe | if is | for Nothing; as for Just | as Nothing; anything else as , under Just |
List | if is | an array | an array whose elements decode as |
Array | if is | an array | an array whose elements decode as |
(, ), (, , ) | if each is | an array of 2 or 3 elements | an array at least as long; further elements ignored |
closed record { : , … } | if each is | an object with exactly the fields as keys | an object with at least those keys; further keys ignored |
Json.Encode.Value | yes | itself | any JSON value; no byte sequence |
Char | no | ||
| a function type | no | ||
| a type variable | no | ||
| an extensible record | no | ||
any other custom type (Result, Order, Dict, Set, and those of the program) | no | ||
any other abstract type (Cmd, Sub, Task, Process.Id, Program) | no |
Referred to from
Tests (0)
No test of the suite checks this figure yet.
Discussions
Discuss this figure·Search the discussions on GitHub
Discussions are on GitHub; one about this figure has [fig:effects-port-table] 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.