29 Aug
2001
29 Aug
'01
2:34 p.m.
Section 3.4 (Expressions.Operator applications) of the language report, says this about prefix negation: Prefix negation has the same precedence as the infix operator - defined in the Prelude (see Table 1). This is not what I expected (and not what other languages mostly do). One of the consequences is that -3 ^ 2 = -9 In most programming languages as well as in mathematics it is quite unusual to have infix operators with a higher priority than prefix operators. Why is this rule chosen in Haskell? Thanks in advance, Rijk-Jan
9130
Age (days ago)
9130
Last active (days ago)
0 comments
1 participants
participants (1)
-
Rijk-Jan van Haaften