arliss_obsidian/fp/Language/Infix Operators/Common Operators/Boolean Logic.md
Orion Kindel 3701b1e2f8
update
2024-09-23 18:56:55 -05:00

1.5 KiB

Infix Operators used for Boolean algebra.

[!info] && and || become short-circuiting when used on functions, e.g. Unit -> Boolean:

a :: Unit -> Boolean
a _ = false

b :: Unit -> Boolean
b _ = unsafeCrashWith "uh-oh!"

c :: Unit -> Boolean
c = a && b

d :: Unit -> Boolean
d = c unit
Operator Description Associativity Precedence Defined As
|| boolean OR right 2 [Data.HeytingAlgrebra.disj](https://pursuit.purescript.org/packages/purescript-prelude/docs/Data.HeytingAlgebra#v:(
&& boolean AND right 3 Data.HeytingAlgrebra.conj
== equals not 4 Data.Eq.eq
/= not equals Data.Eq.notEq
> greater than Data.Ord.greaterThan
< less than Data.Ord.lessThan
>= greater than or equal Data.Ord.greaterThanOrEq
<= less than or equal Data.Ord.lessThanOrEq