Elm Exactly

Basis entryBasics.xor

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

Static basis

var or con ↦ (σ,is)xor ↦ (Bool→Bool→Bool,v)\begin{array}{|rcl|}\hline \var\ \text{or}\ \con {\ }& \mapsto {\ }& (\sigma, \is)\\\hline \href{/standard/basis/Basics/xor}{\kw{xor}} {\ }& \mapsto {\ }& (\tBool \rightarrow \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 ↦ varityxor ↦ basic value2\begin{array}{|rclc|}\hline \var\ \text{or}\ \con {\ }& \mapsto {\ }& v {\qquad}& \arity\\\hline \href{/standard/basis/Basics/xor}{\kw{xor}} {\ }& \mapsto {\ }& \text{basic value} {\qquad}& 2\\\hline\end{array}
Figure 45: Dynamic VE\VE of ME0(Basics)\ME_0(\kw{Basics})

Its APPLY

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

Tests (1)

  • elm-core / BoolXorTest
    The Basics `xor` function gives `True` exactly when its two Bool arguments differ, checked over all four combinations.

Discussions

Discuss this basis entry·Search the discussions on GitHub

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