Are a way to create Curried Functions from infix Operators. This can be seen as the opposite as creating operators, using back quotes ´, from functions of two arguments. This is done by enclosing the operator, and perhaps one of its arguments, in parenthesis.

In general, if # is an operator, then expressions of the form (#), (x #), and (# y) for arguments x and y are called sections, whose meaning as functions can be formalised using lambda expressions as follows:

(#) = \x -> (\y -> x # y)
(x #) = \y -> x # y
(# y) = \x -> x # y

Operator sections are:

Examples

Conversion

The + operator can be converted to a curried function by

(+) 1 2
(1+) 2
(+2) 1

which all give the same results as 1+2.

Constructing functions in a compact way

(1+) is the successor function \y -> 1+y
(1/) is the reciprocation function \y -> 1/y
(*2) is the doubling function \x -> x*2
(/2) is the halving function \x -> x/2

Stating type of operators

(+) :: Int -> Int -> Int

Using operators as arguments

The library function sum which computes the sum of a list of integers can be defined by using the operator + as an argument to the library function foldl in following way

sum :: [Int] -> Int
sum = foldl (+) 0