[MLton] Ad-hoc infix identifiers, Printf, and libraries

skaller skaller@users.sourceforge.net
Fri, 15 Jul 2005 04:26:13 +1000

Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable

On Thu, 2005-07-14 at 19:27 +0200, Andreas Rossberg wrote:
> Vesa Karvonen wrote:
> >=20
> > I'm not exactly sure what you have in mind.
> Consider library A defining operators P, Q, R, and library B defining=20
> operators U, V, W. I can only specify the relative precedences of=20
> operators within one of the libraries. I cannot specify any=20
> inter-library precedences without creating a dependency between the=20
> libraries. Still such precedences might be useful.
> > One could, for example, introduce virtual or place-holder operators for
> > making it easier to combine groups of precedences.  Basically, a librar=
> > would introduce fixity declarations that are only used for the purpose =
> > allowing users to declare precedences relative to the actual operators
> > in the library robustly and conveniently.

How does this sound:

* precedences are just grammars
* grammar productions are just type constructors
* use polymorphic variants

and then just use the usual open recursion technique.

John Skaller <skaller at users dot sourceforge dot net>

Content-Type: application/pgp-signature; name=signature.asc
Content-Description: This is a digitally signed message part

Version: GnuPG v1.2.5 (GNU/Linux)