Restrictionmodules-ports
In a module, the contains a port declaration only if the header is a port module header, and the of a module with a port module header contains at least one port declaration.
Tests (6)
- elm / CovPortIncomingArrayTestA port module declaring an incoming port whose values are `Array Int`.
- elm / CovPortIncomingJSONValueTestA port module declaring an incoming port whose values are `Json.Encode.Value`.
- elm / CovPortIncomingTripleTestA port module declaring an incoming port whose values are an `( Int, String, Bool )` triple.
- elm / CovPortIncomingUnitTestA port module declaring an incoming port whose values are `()`.
- elm / CovPortOutgoingJSONValueTestA port module declaring an outgoing port that sends a `Json.Encode.Value`.
- elm / CovPortOutgoingUnitTestA port module declaring an outgoing port that sends `()`.
In Lean
This restriction is decided on the syntax tree, as the book states it, by Src.PortsInPortModule (StandardElmMech/Src/Restrictions.lean, line 250), whose decider the kernel runs; each written test program has a theorem that it meets the restrictions, or that it breaks this one. No written test program breaks it.
Discussions
Discuss this restriction·Search the discussions on GitHub
Discussions are on GitHub; one about this restriction has [res:modules-ports] 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.