Elm Exactly

Rule 86d-match-fail

MatchesE,v⊢match⇒v′/FAIL\jdgv{E}{v}{\match}{v'/\FAIL}
E,v⊢mrule⇒FAILE,v⊢mrule⇒FAIL\frac{\begin{array}{c}\jdgv{E}{v}{\mrule}{\FAIL}\end{array}}{\begin{array}{c}\jdgv{E}{v}{\mrule}{\FAIL}\end{array}}
(86)
Read it in its chapter·Permanent address: /standard/rules/d-match-fail
TeX source
\defnrule[r:d-match-fail]
  {\jdgv{E}{v}{\mrule}{\FAIL}}
  {\jdgv{E}{v}{\mrule}{\FAIL}}

Tests (2)

  • elm / CaseBranchSelectionTest
    A `case` tries its branches in order: a branch whose pattern fails passes the value on, and the first that matches is evaluated with its pattern's bindings.
  • elm / CaseOrderTest
    Checks that a `case` on an `Order` maps each of `LT`, `EQ` and `GT` to its own string, using the results of `compare` on `Int` values.

Discussions

Discuss this rule·Search the discussions on GitHub

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