Re: [Haskell-cafe] Fixity declaration extension

2012-08-14 Thread Twan van Laarhoven
On 14/08/12 13:46, Ketil Malde wrote: AntC writes: I agree. I don't declare operators very often, and when I do I always struggle to remember which way round the precedence numbers go. [...] (Anything else we can bikeshed about while we're at it?) infixl * before + Perhaps "before"

Re: [Haskell-cafe] Fixity declaration extension

2012-08-14 Thread Ketil Malde
AntC writes: > I agree. I don't declare operators very often, and when I do I always > struggle > to remember which way round the precedence numbers go. [...] > (Anything else we can bikeshed about while we're at it?) infixl * before + Perhaps "before" and "after" clearer than "higher" a

Re: [Haskell-cafe] Fixity declaration extension

2012-08-14 Thread Евгений Пермяков
On 08/14/2012 02:52 PM, Ryan Ingram wrote: On Tue, Aug 14, 2012 at 1:04 AM, Евгений Пермяков > wrote: Your idea looks _much_ better from code clarity point of view, but it's unclear to me, how to deal with it internally and in error messages. I'm not a

Re: [Haskell-cafe] Fixity declaration extension

2012-08-14 Thread Ryan Ingram
On Tue, Aug 14, 2012 at 1:04 AM, Евгений Пермяков wrote: > Your idea looks _much_ better from code clarity point of view, but it's > unclear to me, how to deal with it internally and in error messages. I'm > not a compiler guy, though. > How to deal with it internally: It's pretty easy, actually

Re: [Haskell-cafe] Fixity declaration extension

2012-08-14 Thread Евгений Пермяков
Your idea looks _much_ better from code clarity point of view, but it's unclear to me, how to deal with it internally and in error messages. I'm not a compiler guy, though. Worse, it does not allow to set up fixity relative to operator that is not in scope and it will create unnecessary interm

Re: [Haskell-cafe] Fixity declaration extension

2012-08-13 Thread AntC
Ryan Ingram gmail.com> writes: > > > When I was implementing a toy functional languages compiler I did away with precedence declarations by number and instead allowed the programmer to specify a partial order on declarations; this seems to be a much cleaner solution and avoids arbitrary prec

Re: [Haskell-cafe] Fixity declaration extension

2012-08-13 Thread Ryan Ingram
When I was implementing a toy functional languages compiler I did away with precedence declarations by number and instead allowed the programmer to specify a partial order on declarations; this seems to be a much cleaner solution and avoids arbitrary precedences between otherwise unrelated operator

[Haskell-cafe] Fixity declaration extension

2012-08-12 Thread Евгений Пермяков
fixity declaration has form *infix(l|r)? [Digit]* in haskell. I'm pretty sure, that this is not enough for complicated cases. Ideally, fixity declarations should have form *infix(l|r)? [Digit](\.(+|-)[Digit])** , with implied infinitely long repeated (.0) tail. This will allow fine tuning of op