blob: 327a9d6abdb5b6c8ae2cc90f6c0f978bc9f36d18 (
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)
|