Elm Exactly

Rule 67d-atexp-con

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

Comments

A constructor of a custom type is bound to the constructor value con\con, awaiting all its arguments; the value bound to the constructor of a record type alias is given in Chapter 7.

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

Tests (5)

  • elm / BoolAndTest
    The `&&` operator gives `True` only when both operands are `True`, checked over all four combinations.
  • elm / BoolOrTest
    The `||` operator gives `False` only when both operands are `False`, checked over all four combinations.
  • elm / LssGapCtorAsValue
    A custom type constructor passed as a function argument builds the value it is applied to.
  • elm / LssGapCtorInList
    A custom type constructor stored in a list can be taken out and applied.
  • elm / MaybeNothingTest
    `Debug.log` prints a bare `Nothing` as `Nothing`.

Discussions

Discuss this rule·Search the discussions on GitHub

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