
14 Feb
2010
14 Feb
'10
10:52 a.m.
Christian Maeder schrieb:
S. Doaitse Swierstra schrieb:
weird :: Int -> Int weird = (if True then 3 else 5+)
[...]
infixexp -> fexp qop infixexp | exp10
This is no good, because it would exclude: do ... ++ do expressions.
It would be even possible to avoid parenthesis around sections, because a leading or trailing operator (or just a single operator) uniquely determines the kind of expression.
Maybe this is a solution to the above problem, because "5+" could be legally parsed (and only rejected during type inference). C.