caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: kahl@heraklit.informatik.unibw-muenchen.de
To: caml-list@inria.fr
Cc: garrigue@kurims.kyoto-u.ac.jp
Subject: Re: [Caml-list] Future of labels
Date: 30 Mar 2001 09:45:23 -0000	[thread overview]
Message-ID: <20010330094523.6283.qmail@dionysos.informatik.unibw-muenchen.de> (raw)
In-Reply-To: <20010330120112L.garrigue@kurims.kyoto-u.ac.jp> (message from Jacques Garrigue on Fri, 30 Mar 2001 12:01:12 +0900)

Jacques Garrigue <garrigue@kurims.kyoto-u.ac.jp> replied to
  "Manuel Fahndrich" <maf@microsoft.com>:

> > 1) The standard library requires ~f: labels on many function arguments.
> > That seems silly. I basically had to add ~f: to many places where it did
> > not add disambiguation (f is not a very explicit name). I can see that
> > for partial applications that might be useful, but still I found this a
> > bit annoying.
> 
> Not really for partial application (you rarely want to apply to a list
> before the function), but rather for layout. Mostly a question of
> taste, but if you like it really changes the way you use functionals.
> 
> Anyway, if we remove labels from the standard library, this would
> solve the problem.

I am a long-time label user (having started when OCaml still was
Caml Special Light) and I have therefore gone through quite a few
relabellings of the standard library.
They never really hurt me (with a 50 module 30000 line project) ---
only when labels went away, it meant trouble.
(To make it clear: I ONLY use label mode and do not intend to switch.)

Jacques' words seem to indicate that there seems to be a
complete unlabelling of the standard library in the works ---
I must confess that I do not like that at all.
(Is my interpretation right? I got the impression that
 this was the only change intended for label mode.)
Especially for the ``f'' label!
(This was ``fun'' before the OCaml/OLabl merger
 and had to be changed to accommodate the new rule that
 keywords were not allowed as labels anymore ---
 I'd rather have the keyword ``fun'' replaced by Haskell's ``\'',
 or by a real lambda in a suitable character set!)

My point with the ``f'' label is that I need it almost always:
For List.map, List.fold_right and friends I usually have
only simple list arguments, but complex functions,
and do not see the point why I should
let-define that function beforehand.
So I think it is most readable to write the following:

  let list3 = List.map list2
               ~f:(fun x -> .....
                            ... x ...
                            ..........) in
  ....

If the ``f'' label goes away,
then I need a labelled wrapper around the standard library.
If none is provided, I have to write it myself,
but I would much prefer to have a standard labelling of the standard library,
since this also provides the label-using community with useful conventions and
guidelines.

And I do find the labels in the standard library useful with OCamlBrowser --
I use that much more than my copy of the html-version of the OCaml manual!


Cheers,

Wolfram Kahl







And if the ``f'' label was to go away 
-------------------
To unsubscribe, mail caml-list-request@inria.fr.  Archives: http://caml.inria.fr


  parent reply	other threads:[~2001-04-01 20:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-03-29 19:56 Manuel Fahndrich
2001-03-30  3:01 ` Jacques Garrigue
2001-03-30  8:23   ` Markus Mottl
2001-03-30  9:45   ` kahl [this message]
2001-03-30 10:43     ` Jacques Garrigue
2001-03-30 12:32       ` Benjamin C. Pierce
2001-03-31 21:52         ` [Caml-list] ocamlbrowser [was labels] Brock
     [not found]           ` <27280.986075478@saul.cis.upenn.edu>
2001-04-01  9:28             ` [Caml-list] " Jacques Garrigue
2001-04-01 21:16               ` Benjamin C. Pierce
2001-04-03 17:43                 ` Francisco Valverde Albacete
2001-04-04  7:56                   ` Michael Hicks
2001-04-09  4:43                 ` John Max Skaller
2001-03-30 10:39   ` [Caml-list] Future of labels Judicael Courant
2001-03-30 10:54     ` Jacques Garrigue
2001-03-30 11:22   ` Francois Pottier
2001-03-30 12:41     ` Benjamin C. Pierce
2001-03-30 14:16       ` Jean-Marc Alliot
  -- strict thread matches above, loose matches on Subject: below --
2001-04-11  3:35 G Michael Sawka
2001-03-31  3:40 Yaron M. Minsky
     [not found] <200103300810.AAA05312@mrs.mrs.med.ge.com>
2001-03-30 10:31 ` Jacques Garrigue
2001-03-29 23:47 Arturo Borquez
2001-03-29  0:44 Jacques Garrigue
     [not found] ` <AAEBJHFJOIPMMIILCEPBEEFHCHAA.mattias.waldau@abc.se>
2001-03-29  6:43   ` Jacques Garrigue
2001-03-29 11:44     ` Mattias Waldau
2001-03-29 17:52     ` Mattias Waldau
2001-03-29  8:22 ` Chris Hecker
2001-03-29  9:46 ` Markus Mottl
2001-04-09  1:28   ` John Max Skaller
2001-04-09  8:45     ` Markus Mottl
2001-04-10 18:42       ` John Max Skaller
2001-04-10 22:01         ` Markus Mottl
2001-03-29 12:53 ` Judicael Courant

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20010330094523.6283.qmail@dionysos.informatik.unibw-muenchen.de \
    --to=kahl@heraklit.informatik.unibw-muenchen.de \
    --cc=caml-list@inria.fr \
    --cc=garrigue@kurims.kyoto-u.ac.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).