Elm Exactly

Restrictionprogram-main

Stated in Section 9.1 Syntax of Programs.

The main module has a top-level value declaration that binds main. That declaration has the form main ⟨: ty⟩ = exp\kw{main}\ \opt{\kw{:}\ \ty}\ \kw{=}\ \expm, binding main alone, and main does not occur free in exp\expm, so that main does not refer to itself, directly or through a delayed occurrence.

Read it in its chapter·Permanent address: /standard/restrictions/program-main

Tests (2)

In Lean

This restriction is decided on the syntax tree, as the book states it, by Src.ProgramMain (StandardElmMech/Src/Restrictions.lean, line 369), 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:program-main] 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.