Elm Exactly

Basis entryBasics.not

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

Static basis

var or con ↦ (σ,is)not ↦ (Bool→Bool,v)\begin{array}{|rcl|}\hline \var\ \text{or}\ \con {\ }& \mapsto {\ }& (\sigma, \is)\\\hline \href{/standard/basis/Basics/not}{\kw{not}} {\ }& \mapsto {\ }& (\tBool \rightarrow \tBool, \isv)\\\hline\end{array}
Figure 38: Static VE\VE of ME0(Basics)\ME_0(\kw{Basics}): Constructors, Conversions, Comparison, Booleans and Integer Functions

Dynamic basis

var or con ↦ varitynot ↦ basic value1\begin{array}{|rclc|}\hline \var\ \text{or}\ \con {\ }& \mapsto {\ }& v {\qquad}& \arity\\\hline \href{/standard/basis/Basics/not}{\kw{not}} {\ }& \mapsto {\ }& \text{basic value} {\qquad}& 1\\\hline\end{array}
Figure 45: Dynamic VE\VE of ME0(Basics)\ME_0(\kw{Basics})

Its APPLY

APPLY(not,v) = {False}if v=True = {True}otherwise\begin{array}{rcll} \APPLY(\kw{not},v) {\ }& = {\ }& \{\kw{False}\} {\quad}& \text{if}\ v=\kw{True}\\ {\ }& = {\ }& \{\kw{True}\} {\quad}& \text{otherwise}\end{array}
Read it in its chapter·Permanent address: /standard/basis/Basics/not

Tests (4)

  • elm / InfixPrecOrOverPipeTest
    `||` (precedence 2) binds more tightly than `|>` (precedence 0).
  • elm-core / BoolNotTest
    `not` negates a Bool: `not True` is `False` and `not False` is `True`.
  • elm-core / ControlFlowBooleanWithNotTest
    Checks `not` applied to a comparison: `not (n > 0)` for `n = -5` is `True`.
  • elm-core / NotEqualBoolTest
    `/=` gives the right answer on all four combinations of `Bool` literals, and so does `not` applied to each of those results.

Discussions

Discuss this basis entry·Search the discussions on GitHub

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