From: Dario Teixeira <darioteixeira@yahoo.com>
To: Julien Blond <julien.blond@gmail.com>,
David House <dhouse@janestreet.com>
Cc: OCaml mailing-list <caml-list@inria.fr>
Subject: Re: [Caml-list] The rec/nonrec debate
Date: Mon, 20 May 2013 09:18:48 -0700 (PDT) [thread overview]
Message-ID: <1369066728.52452.YahooMailNeo@web120405.mail.ne1.yahoo.com> (raw)
In-Reply-To: <CAG3nF7WRqkwaSV-LObT_QEiFoXCJU_N3KCFF7=iJS9YVyL2s_g@mail.gmail.com>
Hi,
> I agree that making recursitivy more explicit is... well... more explicit :)
> But I wonder if, in this case, this is truly relevant. In fact, when I look at
> OCaml programs, I see many recursive types and very few type shadowing.
> That is, making types non recursive would add some "rec" or "nonrec"
> keywords everywhere just to avoid a type alias in a rare case. From
> readability point of view, I'm not sure it's a good deal. In the programs
> I know, the ratio seems to be something like 70/30 for nonrec/rec function
> while, this time, shadowing is quite often used. Here, explicit "rec" allows
> us to avoid more "nonrec" elsewhere to continue using shadowing.
In my opinion, even if a statistical analysis of a large corpus of OCaml code
were to show that shadowing is much rarer than recursive type definitions,
the case could still be made that having nonrec as the common default
for both types and values would still be preferable for a) consistency, and
b) avoiding the need to have both "rec" and "nonrec" as keywords.
On a tangent, I also find it interesting that Mezzo has adopted the Haskell
convention of type declarations being head-first. Not that I disagree: in fact,
one could argue there is some inconsistency in the ML/OCaml convention
of declaring types head-last and values head-first...
Cheers,
Dario
next prev parent reply other threads:[~2013-05-20 16:18 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-20 14:31 Dario Teixeira
2013-05-20 14:38 ` David House
2013-05-20 15:18 ` Julien Blond
2013-05-20 15:19 ` David House
2013-05-20 16:18 ` Dario Teixeira [this message]
2013-05-21 14:22 ` Richard W.M. Jones
2013-05-21 15:14 ` Dario Teixeira
2013-05-20 15:17 ` Török Edwin
2013-05-20 16:05 ` Dario Teixeira
2013-05-21 4:07 ` [Caml-list] " Hongbo Zhang
2013-05-21 8:25 ` [Caml-list] " Alain Frisch
2013-05-21 11:15 ` Boris Yakobowski
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=1369066728.52452.YahooMailNeo@web120405.mail.ne1.yahoo.com \
--to=darioteixeira@yahoo.com \
--cc=caml-list@inria.fr \
--cc=dhouse@janestreet.com \
--cc=julien.blond@gmail.com \
/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