Elm Exactly

Rule 89d-mrule-fail

Match RulesE,v⊢mrule⇒v′/FAIL\jdgv{E}{v}{\mrule}{v'/\FAIL}
E,v⊢pat⇒FAILE,v⊢pat -> exp⇒FAIL\frac{\begin{array}{c}\jdgv{E}{v}{\pat}{\FAIL}\end{array}}{\begin{array}{c}\jdgv{E}{v}{\pat\ \kw{->}\ \expm}{\FAIL}\end{array}}
(89)
Read it in its chapter·Permanent address: /standard/rules/d-mrule-fail

Comments

The body exp\expm is not evaluated, so the result is FAIL even when exp\expm has no value.

TeX source
\defnrule[r:d-mrule-fail]
  {\jdgv{E}{v}{\pat}{\FAIL}}
  {\jdgv{E}{v}{\pat\ \kw{->}\ \expm}{\FAIL}}

Tests (8)

  • 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 / BoolShortCircuitParserIdiomTest
    A bounds check guarding an indexing call with `&&` (`idx < length src && unsafeIndex src idx /= ...`) stops the call from running past the end of the input.
  • elm / BoolShortCircuitTest
    `&&` and `||` short-circuit: `False && x` and `True || x` never evaluate `x`.
  • elm / MinimalCaseNextRuleTest
    A value the first rule of a case does not match goes to the next rule.
  • elm / StandardCoreEvaluationExamplesTest
    Small programs for rules of the dynamic semantics of the Core that other tests reach only in passing, and examples from the Comments of A Standard Definition of Elm?, Chapter 6.
  • elm-core / EqualityBoolIfTest
    The result of `==` and `/=` on `Bool` operands drives an `if` expression correctly.
  • elm-core / NotEqualBoolIfTest
    The result of `/=` on two `Bool` literals is used as the condition of an `if`, for all four combinations of operands; each logs `"yes"` exactly when the operands differ.

Discussions

Discuss this rule·Search the discussions on GitHub

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