[Haskell-cafe] Re: Automatic fixity allocation for symbolic
ariep at xs4all.nl
Mon Oct 16 11:18:42 EDT 2006
Nicolas Frisby wrote:
> What if operator precedences were specified as a partial order instead
> of using numbers?
Henning Thielemann wrote:
> dict.leo.org says: "great minds think alike"
Funny, I thought of this too. It seems very natural.
You would probably want an implicit taking of transitive closure, to
reduce the needed number of declarations.
However, to consistently parse an expression, the precedence relation does
not need to be transitive (right? one only needs to compare the precedence
of adjacent operators), so you could even allow cycles in the precedence
graph :s - not sure if that would ever be useful.
> Perhaps Brian's original idea of systematically determining
> unspecified operator precedences could be recast in this system.
> Consider (woefully under contemplated) precedence specifiers such as:
> precInherit <*> -> @*@
> precAll ?+? > ?*?
> Regarding precAll: I'm not a regular expressions/glob for semantics
> fan, but you get the idea.
I'm not convinced that it would be helpful to attach some special meaning
to the "layout" of the operator symbol.
Mr. Pelican Shit may be Willy.
More information about the Haskell-Cafe