Elm Exactly
Results / elm /

HeaderExposesOperatorTest

Tags:elm-spec

Checks, in A Standard Definition of Elm?:restriction modules-no-operator-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 module's header cannot expose an operator.

A Standard Definition of Elm?, restriction modules-no-operator-exposing: an item `(op)` occurs only
in the exposing list of an import; a module declares no operator, so it has none to expose.
<https://elm-test-suite.netlify.app/standard/restrictions/modules-no-operator-exposing>

Results

elm-0.19.1

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

You are trying to expose an operator named (+) but I cannot find its definition.

I do not see any super similar names in this file. Is the definition missing?

Detected problems in 1 module.

elm-0.19.2

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

You are trying to expose an operator named (+) but I cannot find its definition.

I do not see any super similar names in this file. Is the definition missing?

Detected problems in 1 module.

elm-0.19.3

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

You are trying to expose an operator named (+) but I cannot find its definition.

1| module HeaderExposesOperatorTest exposing (main, (+))
                                                    ^^^
I do not see any super similar names in this file. Is the definition missing?

Detected problems in 1 module.

lamdera-1.5.0

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

You are trying to expose an operator named (+) but I cannot find its definition.

1| module HeaderExposesOperatorTest exposing (main, (+))
                                                    ^^^
I do not see any super similar names in this file. Is the definition missing?

Discussions

Discuss this test·Search the discussions on GitHub

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

Source

The -- CHECK: lines give the expected output.

module HeaderExposesOperatorTest exposing (main, (+))
{-| A module's header cannot expose an operator.
A Standard Definition of Elm?, restriction modules-no-operator-exposing: an item `(op)` occurs only
in the exposing list of an import; a module declares no operator, so it has none to expose.
<https://elm-test-suite.netlify.app/standard/restrictions/modules-no-operator-exposing>
-}
-- TAGS: elm-spec, modules-no-operator-exposing
-- COMPILE-ERROR: an operator in a header's exposing list
-- CHECK: {{-- [A-Z ]+ -}}
import Html
main =
let
_ =
Debug.log "sum" (1 + 2)
in
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_HeaderExposesOperatorTest, 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-no-operator-exposing. It holds for every derivation, with no hypothesis about principality.