
10 Oct
2011
10 Oct
'11
8:20 a.m.
2011/10/10 Costello, Roger L.
What's the difference between operator and function?
http://www.haskell.org/onlinereport/exps.html#sect3.2
An operator is either an operator symbol, such as + or $$, or is an ordinary identifier enclosed in grave accents (backquotes), such as `op`. For example, instead of writing the prefix application op x y, one can write the infix application x `op` y. If no fixity declaration is given for `op` then it defaults to highest precedence and left associativity (see Section 4.4.2).
Dually, an operator symbol can be converted to an ordinary identifier by enclosing it in parentheses. For example, (+) x y is equivalent to x + y, and foldr (*) 1 xs is equivalent to foldr (\x y -> x*y) 1 xs.