Rule 10s-atexp-let
Atomic Expressions
(10)
Comments
The variables bound by are in scope in at the type schemes that rule (19) gives them, so may use them polymorphically.
TeX source
\defnrule[r:s-atexp-let]
{\jdg{C}{\dec}{\VE} \premsep \jdg{C + \VE}{\expm}{\tau}}
{\jdg{C}{\kw{let}\ \dec\ \kw{in}\ \expm}{\tau}}Tests (5)
- elm / CombinatorStdlibTCombinatorPipeListIntoComposedOpsTestThe T combinator, built from S and K inside a `let`, passing `[ 1, 2, 3 ]` to the composition of a sum and a doubling map: the result is 12.
- elm / LetMultiFuncTestTwo named functions defined in one `let` and called from later bindings: a local `identity` returns its argument (1) and a local `const` returns the first of two (2).
- elm / MinimalLetTestA let expression with one definition.
- elm / PolyLetConstTestA let-bound polymorphic `const` is used at two different type combinations in the same scope, and each use returns its first argument.
- elm / PolyLetTailRecTwoTypesTestA let-bound, polymorphic, tail-recursive local `foldl` used at two different types in the same expression gives the right result for each.
Discussions
Discuss this rule·Search the discussions on GitHub
Discussions are on GitHub; one about this rule has [r:s-atexp-let] 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.