prefix minus and infix resolution
cgibbard at gmail.com
Thu Jul 15 06:09:21 EDT 2010
I'd just like to remark that I think the current behaviour is the
right thing to do with respect to -x^2. Negation is related to
addition and so should always bind more weakly than multiplicative
On 2010-07-15, at 4:31, Christian Maeder <Christian.Maeder at dfki.de>
> Hi Atze,
> I share your desire for simplicity. In fact, I think my proposal is
> simpler than the existing ones of hugs, ghc, nhc98 and the language
> descriptions (98, 2010), although it's basically a matter of tuning.
> Layout and the type system are far more involving and should not
> interfere with fixity resolution!
> Simon said somewhere that fixity resolution takes basically 12 lines
> haskell code. (My algorithm has 40 but shorter ones.)
> Furthermore, fixity resolution is a nice subject for teaching in
> conjunction with expression evaluation.
> I added a remark to the end of
> about rejecting prefix minus applications that do not bind tightly. It
> would use the same resolution algorithm with one modified line.
> It says: reject "- 1 ^ 2" always without parens in order to avoid the
> too simple (wrong) resolution as "(- 1) ^ 2".
More information about the Haskell-prime