Elm Exactly
Results / elm /

HeaderExposesUndeclaredValueTest

Tags:elm-spec

Checks, in A Standard Definition of Elm?:restriction modules-header-exposing

Not translated into Lean for the mechanisation of the book: see why.

elm-0.19.1 passelm-0.19.2 passelm-0.19.3 passlamdera-1.5.0 pass
A header exposes only values the module declares.

A Standard Definition of Elm?, restriction modules-header-exposing: each item `x` of a header's
exposing list is bound by a value or port declaration of the module. `missing` is not.
<https://elm-test-suite.netlify.app/standard/restrictions/modules-header-exposing>

Results

elm-0.19.1

pass
Output
Compiling ...-- UNKNOWN EXPORT --------------------- src/HeaderExposesUndeclaredValueTest.elm

You are trying to expose a value named `missing` but I cannot find its
definition.

Maybe you want main instead?

Detected problems in 1 module.

elm-0.19.2

pass
Output
Compiling ...-- UNKNOWN EXPORT --------------------- src/HeaderExposesUndeclaredValueTest.elm

You are trying to expose a value named `missing` but I cannot find its
definition.

Maybe you want main instead?

Detected problems in 1 module.

elm-0.19.3

pass
Output
Compiling ...-- UNKNOWN EXPORT --------------------- src/HeaderExposesUndeclaredValueTest.elm

You are trying to expose a value named `missing` but I cannot find its
definition.

1| module HeaderExposesUndeclaredValueTest exposing (main, missing)
                                                           ^^^^^^^
Maybe you want main instead?

Detected problems in 1 module.

lamdera-1.5.0

pass
Output
Detected problems in 1 module.
-- UNKNOWN EXPORT --------------------- src/HeaderExposesUndeclaredValueTest.elm

You are trying to expose a value named `missing` but I cannot find its
definition.

1| module HeaderExposesUndeclaredValueTest exposing (main, missing)
                                                           ^^^^^^^
Maybe you want main instead?

Discussions

Discuss this test·Search the discussions on GitHub

Discussions are on GitHub; one about this test has [t:elm/HeaderExposesUndeclaredValueTest] in its title.

Source

The -- CHECK: lines give the expected output.

module HeaderExposesUndeclaredValueTest exposing (main, missing)
{-| A header exposes only values the module declares.
A Standard Definition of Elm?, restriction modules-header-exposing: each item `x` of a header's
exposing list is bound by a value or port declaration of the module. `missing` is not.
<https://elm-test-suite.netlify.app/standard/restrictions/modules-header-exposing>
-}
-- TAGS: elm-spec, modules-header-exposing
-- COMPILE-ERROR: a header exposing an undeclared value
-- CHECK: {{-- [A-Z ]+ -}}
import Html
main =
Html.text "done"

Lean translation

No reduced program for Lean's evaluator: the test expects a compile error, so it has no meaning to evaluate. Lean has the program as written, in source syntax, and proves what the static semantics says of it (below). See the Lean mechanisation for which tests are in Lean, and why.

Static semantics: Lean proves that the program as written is not legal, so a compiler must reject it (refuse_elm_HeaderExposesUndeclaredValueTest, in StandardElmMech/Certs/). The program breaks a syntactic restriction, which the kernel checks on its syntax tree; no type inference is involved (Stat.not_legal_of_syn): res:modules-header-exposing. It holds for every derivation, with no hypothesis about principality.