summaryrefslogtreecommitdiff
path: root/testsuite/tests/rename/should_fail/rnfail017.hs
blob: 9090e23e3f846c98dbbc49034aea96c2bd5958ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module ShouldFail where

-- !!! Precedence of unary negation

f1 x y = x + -y         -- Fails
f2 x y = x * -y         -- Fails


f3 x y = -x + y         -- OK: means  (-x) + y
                        -- since - is left associative

f4 x y = - x*y          -- OK: means -(x*y)
                        -- since - binds less tightly than *

f5 x y = x >= -y        -- OK means x >= (-y)