Elm Exactly

Rule 175p-dyn-module

Evaluation of ProgramsBDYN⊢DYNprogram⇒v\jdyn{\pgBdyn}{\program}{v}
BDYN⊢module⇒BDYN′,VEBDYN+BDYN′⊢DYNprogram⇒vBDYN⊢DYNmodule program⇒v\frac{\begin{array}{c}\jdg{\pgBdyn}{\modm}{\pgBdyn',\VE}\premsep \jdyn{\pgBdyn+\pgBdyn'}{\program}{v}\end{array}}{\begin{array}{c}\jdyn{\pgBdyn}{\modm\ \program}{v}\end{array}}
(175)
Read it in its chapter·Permanent address: /standard/rules/p-dyn-module

Comments

A module is evaluated once, after every module it imports, and its top-level values are evaluated then, whether or not they are used: every top-level declaration has its default copy, even when nothing uses it. A main in a module other than the main module is evaluated in the same way, once, as an ordinary value.

TeX source
\defnrule[r:p-dyn-module]
  {\jdg{\pgBdyn}{\modm}{\pgBdyn',\VE}\premsep
   \jdyn{\pgBdyn+\pgBdyn'}{\program}{v}}
  {\jdyn{\pgBdyn}{\modm\ \program}{v}}

Tests (2)

Discussions

Discuss this rule·Search the discussions on GitHub

Discussions are on GitHub; one about this rule has [r:p-dyn-module] 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.