Skip to content
Snippets Groups Projects
Commit 7e9bd3d5 authored by Simon Peyton Jones's avatar Simon Peyton Jones
Browse files

[project @ 1999-07-26 15:30:29 by simonpj]

Add rnfail017
parent bca10d12
No related merge requests found
module ShouldFail where
-- !!! Pattern syntax in expressions
f x = x @ x
g x = ~ x
h x = _
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)
rnfail017.hs:5:
precedence parsing error
cannot mix `+' (infixl 6) and `negate' (infixl 6) in the same infix expression
rnfail017.hs:6:
precedence parsing error
cannot mix `*' (infixl 7) and `negate' (infixl 6) in the same infix expression
Compilation had errors
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment