Version française
Home     About     Download     Resources     Contact us    
Browse thread
Re: Language improvements (?)
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Michel.Mauny@i...
Subject: Re: Language improvements (?)

> > 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