Native functions

Native functions #

Syntax. Many native functions/operators (e.g. over numbers or Boolean values) have the same syntax in Haskell and Java. This includes equality (==), sum (+), product (*), etc.

We highlight below a few cases where the two syntaxes differ:

meaning syntax in Haskell example syntax in Java example
inequality /= x /= 2 != x != 2
negation (NOT) not not x ! !x
disjunction (OR) || x || y || (lazy evaluation) or
| (full evaluation)
x || y or
x | y
conjunction (AND) && x && y && (lazy evaluation) or
& (full evaluation)
x && y or
x & y