Performing operations from boolean algebra is also quite straightforward in Elm.
||- Boolean or - returns true if at least one input is True.
&&- Boolean and - returns true only if both options are True.
not- Boolean negation - returns the opposite value of the input.
xor- Boolean exclusive-or - returns True if exactly one input is True.
Some programming languages treat the number zero or
null as synonymous with
False. Elm doesn’t allow that, nor does it consider a non-zero value to be
True. For a condition to be true, it must evaluate exactly to the value