Elm Exactly

Basis entryBasics.eq

A value of Basics. Its type is in Section C.3 Basics.

Static basis

op stands for ↦ OTSTAT(op)==, /= eq, neq ↦ (∀a. a→a→Bool,v)\begin{array}{|clcl|}\hline \opv {\ }& \text{stands for} {\ }& \mapsto {\ }& \OTstat(\opv)\\\hline \kw{==},\ \kw{/=} {\ }& \href{/standard/basis/Basics/eq}{\kw{eq}},\ \href{/standard/basis/Basics/neq}{\kw{neq}} {\ }& \mapsto {\ }& (\forall\mv{a}.\,\mv{a} \rightarrow \mv{a} \rightarrow \tBool, \isv)\\\hline\end{array}
Figure 40: The Static Operator Table, OTSTAT\OTstat

Dynamic basis

opstands for ↦ OTDYN(op)arity==, /=eq, neq ↦ basic value2\begin{array}{|clclc|}\hline \opv {\quad}& \text{stands for} {\ }& \mapsto {\ }& \OTdyn(\opv) {\qquad}& \arity\\\hline \kw{==},\ \kw{/=} {\quad}& \href{/standard/basis/Basics/eq}{\kw{eq}},\ \href{/standard/basis/Basics/neq}{\kw{neq}} {\ }& \mapsto {\ }& \text{basic value} {\qquad}& 2\\\hline\end{array}
Figure 46: The Dynamic Operator Table, OTDYN\OTdyn

Its APPLY

APPLY(eq,v,v′)=Eq(v,v′),\begin{array}{rcl} \APPLY(\kw{eq},v,v') &=& \dbEq(v,v'),\end{array}
Read it in its chapter·Permanent address: /standard/basis/Basics/eq

Tests (29)

  • elm / ArrayEqualityFlagsTest
    Two arrays are equal under `==` when they hold equal elements in the same order: arrays received as flags are compared, with the same elements, a different element, and a different length.
  • elm / AstralCharLiteralTest
    A `Char` literal above U+FFFF has its full code point: `'\u{1F600}'` is 128512, and is the same character as `'😀'` written directly.
  • elm / CoreIssue988NanContainerSelfEqualityTest
    In Elm 0.19.1 any container holding NaN equals itself, because `(==)` first checks whether the two sides are the same object.
  • elm / DeepEqualityTest
    `==` and `/=` give the exact answer on values nested more than 100 levels deep.
  • elm / FloatEdgeTest
    Float edge cases: `round` on halves, NaN in equality, `min` and `compare`, `truncate` of NaN, and an Int power beyond 2^32.
  • elm / InfixPrecAppendOverEqTest
    `++` (precedence 5) binds more tightly than `==` (precedence 4).
  • elm-core / CompareCustomWithEmptyListFieldTest
    Ordering and equality of a custom type whose `List Int` field may be empty.
  • elm-core / CompareRecordWithEmptyListFieldTest
    Ordering and equality of a record whose `List Int` field may be empty.
  • elm-core / CompilerIssue2362NanTupleEqualityTest
    A tuple holding NaN is not equal to anything, including itself.
  • elm-core / ContainerEqualityCharTest
    Checks `==` on pairs, triples and lists of `Char`.
  • elm-core / ContainerEqualityCustomFloatTest
    Checks `==` on custom-type values whose fields are `Float`, including NaN, infinities and negative zero.
  • elm-core / ContainerEqualityFloatTest
    Checks `==` on pairs, triples and lists of `Float`, including NaN, infinities and negative zero.
  • elm-core / ContainerEqualityIntTest
    Checks `==` on pairs, triples and lists of `Int`.
  • elm-core / ContainerEqualityRecordFloatTest
    Checks `==` on records whose fields are `Float`, including NaN, infinities and negative zero.
  • elm-core / ContainerEqualityStringTest
    Checks `==` on pairs, triples and lists of `String`.
  • elm-core / CoreIssue1115NanEqualsLiteralZeroTest
    NaN compared with a literal `0` is not equal, on either side of `==`.
  • elm-core / CoreIssue988NanEqualityReferenceTest
    Structural equality of values containing NaN depends on reference identity.
  • elm-core / EqBoxedFastPathTest
    Structural equality gives the correct answer for strings, lists, tuples, records, custom types, unit, empty values, `Bool` and nested containers, through both `==` and `/=`.
  • elm-core / EqualityBoolContainerTest
    Structural equality compares `Bool` elements inside tuples and lists correctly.
  • elm-core / EqualityBoolIfTest
    The result of `==` and `/=` on `Bool` operands drives an `if` expression correctly.
  • elm-core / EqualityBoolMaybeTest
    Equality on `Maybe Bool` compares the wrapped `Bool` values and tells `Nothing` apart from `Just`.
  • elm-core / EqualityBoolRecordTest
    Record equality compares `Bool` fields correctly.
  • elm-core / EqualityBoolTest
    `==` and `/=` on `Bool` literals give the correct answer for all four combinations of operands.
  • elm-core / EqualityBoolVarTest
    `==` on `Bool` values gives the correct answer when the operands are variables or arguments rather than literals.
  • elm-core / EqualityOtherConstantsTest
    `==` on empty and non-empty values of `String`, `List Int`, `Maybe Int` and `()` gives the right answer in both argument orders.
  • elm-core / EqualityTest
    `==` and `/=` give the right answer on `Int` literals, and `==` is `True` for two equal `List Int` literals.
  • elm-core / FloatCompareTest
    `<`, `>`, `<=`, `>=`, `==` and `/=` on `Float` literals, each in a case where the comparison is `True`.
  • elm-core / FloatNegativeZeroTest
    Negative zero (`-0.0`) equals 0.0, and dividing 1.0 by it gives -Infinity while dividing by 0.0 gives Infinity.
  • elm-core / IntCompareTest
    Checks that the six comparison operators `<`, `>`, `<=`, `>=`, `==` and `/=` give `True` on Int literals.

Discussions

Discuss this basis entry·Search the discussions on GitHub

Discussions are on GitHub; one about this basis entry has [b:Basics.eq] 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.