[Haskell-cafe] Automatic fixity allocation for symbolic operators

Nicolas Frisby nicolas.frisby at gmail.com
Sat Oct 14 15:24:35 EDT 2006


Perhaps the editor could assume a default precedence when the
user-defined precedence is not yet available. Preferably, the editor
would also somehow yell at the user to indicate that it is making such
an assumption.

I think it's unreasonable to tie programmers' hands for the sake of
off-loading rather trivial tasks to editors.

Nick

On 10/14/06, Bertram Felgenhauer <bertram.felgenhauer at googlemail.com> wrote:
> Brian Hulley wrote:
> >    infixr 9  .    !!                               9    9.9
> >    infixr 8  ^, ^^, **                        8   8.8    7.7
> >    infixl 7  *, /,                                7    7
> >    infixl 6  +, -                                6     6
> >    infixr 5  : , ++                             5    6.6
> >    infix  4  ==, /=, <, <=, >=, >      4.4   7.4   1    1.4    1.4    1
> >    infixr 3  &&                                3.3
> >    infixr 2  ||                                    2.2
> >    infixl 1  >>, >>=                        1.1    1.14
> >    infixr 1  =<<                                1.14
> >    infixr 0  $, $!                                0    0.9
>
> Ouch.
>
> Really, the first priority in the language should be human readability.
> Looking up a fixity isn't that hard, but remembering a rule like this
> is pretty awful. You also restrict the freedom of library designers
> for no good reason. Precedences aren't usually random ...
>
> As far as editors go I have little sympathy. I also see nothing wrong
> with forcing a coder to have at least a module stub that defines its
> interface and the operator precedences, to make the parsing work
> reliably. You'll have to deal with the case where parsing fails anyway,
> and it shouldn't be too hard between failures due to unsufficient
> information (which shouldn't be tagged as errors, but maybe give some
> other indication) and real errors.
>
> Bertram
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>


More information about the Haskell-Cafe mailing list