Fractional/negative fixity?
Robert Dockins
robdockins at fastmail.fm
Tue Nov 7 17:49:22 EST 2006
On Tuesday 07 November 2006 17:32, Lennart Augustsson wrote:
> On Nov 7, 2006, at 11:47 , apfelmus at quantentunnel.de wrote:
> > Henning Thielemann wrote:
> >> On Tue, 7 Nov 2006, Simon Marlow wrote:
> >>> I'd support fractional and negative fixity. It's a simple change to
> >>> make, but we also have to adopt
> >>>
> >>> http://hackage.haskell.org/cgi-bin/haskell-prime/trac.cgi/wiki/
> >>> FixityResolution
> >>>
> >>> I've added the proposal to the end of that page. In fact, the page
> >>> already mentioned that we could generalise fixity levels, but it
> >>> didn't
> >>> mention fractional or negative values being allowed.
> >>
> >> Maybe that page could also mention earlier proposals and the
> >> solutions
> >> without precedence numbers. I prefer the non-numeric approach with
> >> rules
> >> like "(<) binds more tightly than (&&)", because it says what is
> >> intended
> >> and it allows to make things unrelated that are unrelated, e.g. infix
> >> operators from different libraries. Consequently a precedence
> >> relation to
> >> general infix operators like ($) and (.) had be defined in each
> >> library.
> >
> > I think that computable real fixity levels are useful, too. A further
> > step to complex numbers is not advised because those cannot be
> > ordered.
>
> But ordering of the computable reals is not computable. So it could
> cause the compiler to loop during parsing. :)
>
> -- Lennart
Ha! Well, as long as we're being pedantic, surely we wouldn't need any set
larger than the rationals (which does have a decidable ordering)?
Also, since I'm commenting anyway, I rather like the idea of specifying
operator precedences via a partial order. However, I also feel that there
needs to be some work done to make sure there aren't gremlins hiding in the
details. Has anyone worked out the theory on this? How does associating to
the right vs left play into the picture? How does it fit into the parsing
technology?
--
Rob Dockins
Talk softly and drive a Sherman tank.
Laugh hard, it's a long way to the bank.
-- TMBG
More information about the Haskell-prime
mailing list