Rule 90d-dec-nonrec
Comments
Rules (90) and (91) cover the one production, distinguished by whether the declaration is recursive (Section 6.6). The right-hand sides are evaluated in , without the variables the declaration binds; in a recursive declaration every right-hand side is a lambda, and gives each of its closures the bindings of the whole declaration. is not applied to a declaration that is not recursive, since a closure it binds may have been made elsewhere, in an environment where a variable spelt as one that the declaration binds denotes something else. A let declaration needs only because every binding of a recursive let declaration is a function (Section 2.10); top-level declarations, whose recursive members need not be functions, are treated in Chapter 7.
Referred to from
TeX source
\defnrule[r:d-dec-nonrec]
{\jdg{E}{\valbind}{\VE}\premsep\Dom\VE\cap\dcoreFV(\valbind)=\emptyset}
{\jdg{E}{\valbind}{\VE}}Tests (3)
- elm / LetBasicTestTwo groups of `let` bindings, where later bindings use earlier ones: `x + y` on two Int literals gives 5, and `"hello" ++ " " ++ "world"` gives `"hello world"`.
- elm / LetMultipleTestFive Int bindings in one `let` combined by two later bindings: their sum (15) and their product (120).
- elm / MinimalLetTestA let expression with one definition.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:d-dec-nonrec] 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.