| ... | ... | @@ -88,6 +88,7 @@ As a further option it is possible to support multiple prefix minus application. |
|
|
|
|
|
|
|
For other examples see
|
|
|
|
[ http://www.haskell.org/pipermail/haskell-prime/2010-July/003229.html](http://www.haskell.org/pipermail/haskell-prime/2010-July/003229.html)
|
|
|
|
(it also shows how easy an implementation is)
|
|
|
|
|
|
|
|
|
|
|
|
Mixfix analysis \[Aasa95\] usually only considers the top-level operators of argument terms.
|
| ... | ... | @@ -100,4 +101,33 @@ Other specification languages (like HasCASL) do so, too. For instance the logica |
|
|
|
|
|
|
|
My point 3. is backed by the fact that "in case of doubt" prefix application should bind stronger than infix application.
|
|
|
|
|
|
|
|
## Report Delta |
|
|
\ No newline at end of file |
|
|
|
## Report Delta
|
|
|
|
|
|
|
|
|
|
|
|
In
|
|
|
|
[ http://www.haskell.org/onlinereport/haskell2010/](http://www.haskell.org/onlinereport/haskell2010/)
|
|
|
|
|
|
|
|
|
|
|
|
remove "same precedence" stuff
|
|
|
|
|
|
|
|
|
|
|
|
haskellch3.html\#x8-220003
|
|
|
|
"Negation is the only prefix operator in Haskell; it has the same precedence as the infix - operator defined in the Prelude (see Section 4.4.2, Figure 4.1)."
|
|
|
|
|
|
|
|
|
|
|
|
haskellch3.html\#x8-280003.4
|
|
|
|
"Prefix negation has the same precedence as the infix operator - defined in the Prelude (see Table 4.1)"
|
|
|
|
|
|
|
|
|
|
|
|
Possibly refer to haskellch10.html\#x17-17900010.6 "10.6 Fixity Resolution"
|
|
|
|
|
|
|
|
|
|
|
|
replace:
|
|
|
|
"The handling of the prefix negation operator, -, complicates matters only slightly. Recall that prefix negation has the same fixity as infix negation: left-associative with precedence 6. The operator to the left of -, if there is one, must have precedence lower than 6 for the expression to be legal. The negation operator itself may left-associate with operators of the same fixity (e.g. +). So for example -a + b is legal and resolves as (-a) + b, but a + -b is illegal."
|
|
|
|
|
|
|
|
|
|
|
|
with:
|
|
|
|
"The handling of the prefix negation operator, -, complicates matters only slightly. (Recall that) prefix negation has lower precedence than infix multiplication. The operator to the left of prefix -, if there is one, is ignored. So a + -b or a \* -b are legal. Prefix negation binds tighter with infix operators to the right of lower precedence than multiplication. So for example -a + b is legal and resolves as (-a) + b."
|
|
|
|
|
|
|
|
|
|
|
|
(Use may algorithm from [ http://hackage.haskell.org/trac/ghc/ticket/4180](http://hackage.haskell.org/trac/ghc/ticket/4180)) |