operators
infix function
> :type (==)
forall (@a :: Type). Eq a => a -> a -> Boolean
-
operator
- the equality operator, = = is a function. So are +, *, -, / and pretty much all operators.
-
If a function is comprised only of special characters, it's considered an infix function by default.
we have to surround it in parentheses, if we want to
- examine its type (use
:tor:type) - pass it to another function or
- call it as a prefix function
Operators can be partially applied by surrounding them with parentheses and using _ as one of the operands: https://github.com/purescript/documentation/blob/master/language/Syntax.md#operator-sections
add5 x = 5 + x
add5 x = add 5 x
add5 x = (+) 5 x
add5 x = 5 `add` x
add5 = add 5
add5 = \x -> 5 + x
add5 = (5 + _)
add5 x = 5 `(+)` x -- Yo Dawg, I herd you like infix, so we put infix in your infix!