Elm Exactly

Rule 66d-atexp-var

Atomic ExpressionsE⊢atexp⇒v\jdg{E}{\atexp}{v}
E(longvar)=vE⊢longvar⇒v\frac{\begin{array}{c}E(\longvar)=v\end{array}}{\begin{array}{c}\jdg{E}{\longvar}{v}\end{array}}
(66)
Read it in its chapter·Permanent address: /standard/rules/d-atexp-var

Comments

As in the static semantics, long variables are looked up in the environment. The identifier status of the static semantics plays no part.

TeX source
\defnrule[r:d-atexp-var]
  {E(\longvar)=v}
  {\jdg{E}{\longvar}{v}}

Tests (5)

  • elm / DebugLogLambdaBoundaryTest
    A `case` branch that returns a lambda whose parameter is named `log` can still call `Debug.log` inside that lambda.
  • elm / MinimalVariableTest
    A top-level variable denotes the value of its definition.
  • elm-core / FloatNegativeZeroTest
    Negative zero (`-0.0`) equals 0.0, and dividing 1.0 by it gives -Infinity while dividing by 0.0 gives Infinity.
  • elm-core / FloatSubTest
    Float subtraction gives the expected value, including when the right operand is a negative literal.
  • elm-core / IntSubTest
    Checks integer subtraction `-`, including subtracting a negative literal.

Discussions

Discuss this rule·Search the discussions on GitHub

Discussions are on GitHub; one about this rule has [r:d-atexp-var] 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.