[Haskell-cafe] Fractional/negative fixity?

Nicolas Frisby nicolas.frisby at gmail.com
Wed Nov 8 10:38:43 EST 2006


Well let's see. First I'll assume that

prec $! = $

is how $! was specified. Thus we know both ?? < $ and $! = $. Let's
derive the relation between ?? and $!

     ?? < $
=> ?? < $!    {$ = $!}

So I think that is pretty straight-forward. ":)" is a parse error... ;)

This does bring up the interesting case where we want an operator
between $ and $! (or some less offensive pair of operators with equal
precedence). This, like Danielsson's later post, is a case that
deserves some thought. If we handle such cases in a consistent way, I
think we might have something quite useful.

On the positive side, when I want $! to behave like $ (or perhaps more
appropriately =*= to behave like ==) then I don't have to lookup the
numeric precedence of $ (or ==). I can just say

prec $! = $

and be done with it. There's no arbitrary middle man.

Nick


On 11/8/06, Bulat Ziganshin <bulat.ziganshin at gmail.com> wrote:
> Hello Nicolas,
>
> Wednesday, November 8, 2006, 1:25:23 AM, you wrote:
>
> >   prec ?? < $
> > over-specification). You want ?? to bind more tightly than does $;
> > that's exactly what this approach would let you specify.
>
> and how then compiler will guess that is relational priority of this
> operator comparing to '$!' ? :)
>
>
> --
> Best regards,
>  Bulat                            mailto:Bulat.Ziganshin at gmail.com
>
>


More information about the Haskell-Cafe mailing list