caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Zheng Li <li@pps.jussieu.fr>
To: caml-list@inria.fr
Subject: Re: Why isn't -rectypes command line option the default
Date: Wed, 21 Mar 2007 02:48:45 +0100	[thread overview]
Message-ID: <87vegvv01u.fsf@pps.jussieu.fr> (raw)
In-Reply-To: <20070321113430.f32c802a.mle+ocaml@mega-nerd.com>

Erik de Castro Lopo <mle+ocaml@mega-nerd.com> writes:
> but I was wondering if there was a reason why -rectypes wasn't the
> default.
It's consciously disabled to avoid mysterious report of errors. Many careless
coding errors can be typed with recursive types, for example

# fun x-> x::x;;
- : ('a list as 'a) -> 'a list = <fun>

in this case, the programmer is probably thinking of connecting @ two
list. With recursive types, instead of a immediately type error report in
place, the function is typed without any problem, and finally some accident may
be happened far away from here, where the original function is likely to be under
several layers of composition and hard to recognized. 

So the main consideration is safety, though it's really fun to play with
recursive types sometimes.

-- 
Zheng Li
http://www.pps.jussieu.fr/~li


  reply	other threads:[~2007-03-21  1:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-21  0:34 Erik de Castro Lopo
2007-03-21  1:48 ` Zheng Li [this message]
2007-03-21  2:13   ` [Caml-list] " Erik de Castro Lopo
2007-03-21  5:37     ` james woodyatt
2007-03-21  7:08       ` Erik de Castro Lopo
2007-03-21  9:01     ` Ville-Pertti Keinonen
2007-03-21 12:47     ` Gerd Stolpmann
2007-03-21  1:24 Jeffrey Loren Shaw

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=87vegvv01u.fsf@pps.jussieu.fr \
    --to=li@pps.jussieu.fr \
    --cc=caml-list@inria.fr \
    /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).