Re: [Haskell-cafe] Re: Automatic fixity allocation for symbolic operators

2006-10-17 Thread Nils Anders Danielsson
On Mon, 16 Oct 2006, Jón Fairbairn [EMAIL PROTECTED] wrote:

 I made a more concrete proposal later and Phil Wadler tidied it up.
 I think It even got as far as a draft of the language, [...]

Do you know where this proposal/draft can be found?

-- 
/NAD

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Automatic fixity allocation for symbolic operators

2006-10-17 Thread Jón Fairbairn
Nils Anders Danielsson [EMAIL PROTECTED] writes:

 On Mon, 16 Oct 2006, Jón Fairbairn [EMAIL PROTECTED] wrote:
 
  I made a more concrete proposal later and Phil Wadler tidied it up.
  I think It even got as far as a draft of the language, [...]
 
 Do you know where this proposal/draft can be found?

On the fplangc mailing list. Thomas Johnsson has the
archive, but as it was a closed mailing list I don't know if
it's OK to publish the URL.

-- 
Jón Fairbairn [EMAIL PROTECTED]

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Automatic fixity allocation for symbolic operators

2006-10-16 Thread Arie Peterson
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.

  ^
 /e\
 ---


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Automatic fixity allocation for symbolic operators

2006-10-16 Thread Jón Fairbairn
Nicolas Frisby [EMAIL PROTECTED] writes:

 What if operator precedences were specified as a partial order instead
 of using numbers?

I suggested something that did that to fplangc back in
1987...  Thu, 19 Nov 87 17:49:50 GMT in fact! Simon PJ later
forwarded a message from Stef Joosten to similar effect... I
made a more concrete proposal later and Phil Wadler tidied
it up. I think It even got as far as a draft of the
language, but I think it was decided that it was just too
difficult (both for human and computer) to parse.

-- 
Jón Fairbairn [EMAIL PROTECTED]
http://www.chaos.org.uk/~jf/Stuff-I-dont-want.html  (updated 2006-09-13)

___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


[Haskell-cafe] Re: Automatic fixity allocation for symbolic operators

2006-10-16 Thread Arie Peterson
Good evening,


Bulat Ziganshin wrote:

 but when you want to have user-defined operators, that will mean that
 you need either to define precedences to all other operators
 (including those from other libs), or sometimes user programs will not
 compile because they used combination of operators with undefined
 precedence

 good for making good headache :)

Why is that?

A library would indeed only declare the relative precedence of its
operators with respect to operators that 1) it knows of; and 2) are
related (or general) enough so that there is a reasonable choice of
precedence. I think it is even good to force the user to declare any
other, more uncommon, precedences; better than the current situation,
where the relative precedence of operators from unrelated libraries is
fixed pretty much arbitrarily, as an artefact of the imposed total order.


Regards,

Arie


-- 

Mr. Pelican Shit may be Willy.

  ^
 /e\
 ---


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


Re: [Haskell-cafe] Re: Automatic fixity allocation for symbolic operators

2006-10-16 Thread Nicolas Frisby

I would imagine (reading into Jon Fairbairn's note) that the
difficulty is in combining it with the traditional handling of
precedences in parsing systems, as Bulat was describing. AFAIK, which
is not much on this topic, the notion of precedence in traditional LR
spewers is strictly tied to numeric precedences that are known pretty
much a priori.

Since mapping all the way to numbers seems like overkill to resolve
such infix ambiguities, I'd expect such an adjustment to parser
generators wouldn't be horrific--it may even be more natural on the
implementation side.

Nick

On 10/16/06, Arie Peterson [EMAIL PROTECTED] wrote:

Good evening,


Bulat Ziganshin wrote:

 but when you want to have user-defined operators, that will mean that
 you need either to define precedences to all other operators
 (including those from other libs), or sometimes user programs will not
 compile because they used combination of operators with undefined
 precedence

 good for making good headache :)

Why is that?

A library would indeed only declare the relative precedence of its
operators with respect to operators that 1) it knows of; and 2) are
related (or general) enough so that there is a reasonable choice of
precedence. I think it is even good to force the user to declare any
other, more uncommon, precedences; better than the current situation,
where the relative precedence of operators from unrelated libraries is
fixed pretty much arbitrarily, as an artefact of the imposed total order.


Regards,

Arie


--

Mr. Pelican Shit may be Willy.

  ^
 /e\
 ---


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe


___
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe