Message-Id: <199607251226.OAA01398@pauillac.inria.fr>
Subject: Re: Language improvements (?)
To: Pierre.Weis@inria.fr (Pierre Weis)
Date: Thu, 25 Jul 1996 14:26:40 +0200 (MET DST)
In-Reply-To: <199607240844.KAA21840@pauillac.inria.fr> from "Pierre Weis" at Jul 24, 96 10:44:17 am
From: Michel.Mauny@inria.fr (Michel Mauny)
> > Third, since the trend in O'Caml is toward curried function types,
> > it would be useful to be able to section binary operators as in
> > Haskell, e.g., "(1+)" would mean "(function x -> 1 + x)".
Your example works in ocaml: (+) 1 denotes the function above. But,
the only way to partially apply (+) to its second argument is to give
a name to the first one as in (fun x -> x+2).
Personnally, I don't think sections are really useful.
> > And, at the risk of instigating a syntax war, I would prefer a more
> > Haskell-like syntax overall; for example, offside scoping,
I don't like it either. (And it would be a really pain to implement it
with Yacc, I think -- if ever possible.)
> > [Type constructors with] uppercase types so
> > there is no need for quotes in front of type variables,
> No, no, we already exhausted uppercase conventions with modules,
> constructors, labels, and let bound identifiers.
Here, I disagree with Pierre: it would be possible because type
constructors occur only in very specific contexts. The parser just has
to consider that a type constructor (putting aside the arrow) is a
(possibly empty) module access path preceeding an uppercase
identifier, that is the type name. There is no conflict with the other
usage of uppercase idents (data constructors) because they occur in
different contexts.
However, writing type expressions as in Haskell is probably just a
cosmetic issue.
-- Michel