forked from orion/obsidian
358 B
358 B
Infix Operators are defined with the keyword infix
, infixl
or infixr
.
infix <precedence> <fn> as <operator>
-- or
infixl -- ..
-- or
infixr -- ..
e.g.
eq :: Int -> Int -> Boolean
eq = -- ...
add :: Int -> Int -> Int
add = -- ...
infixl 2 add as +
infixl 1 eq as ==
1 + 2 == 3
-- same as
(eq (add 1 2) 3)