caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Markus Mottl <markus@oefai.at>
To: Oleg <oleg_inconnu@myrealbox.com>
Cc: Michael Hicks <mwh@cs.umd.edu>, caml-list@inria.fr
Subject: Re: [Caml-list] Cyclic ?!
Date: Thu, 15 Aug 2002 20:05:52 +0200	[thread overview]
Message-ID: <20020815180552.GB26027@fichte.ai.univie.ac.at> (raw)
In-Reply-To: <200208151725.NAA12685@dewberry.cc.columbia.edu>

On Thu, 15 Aug 2002, Oleg wrote:
> I'm not sure I understand you. If the two definitions are equivalent WRT 
> Empty <-> None & Node <-> Some name substitution, then the fact that the 
> compiler accepts one, but not the other must be a bug, yes?

This is not a bug, because you can have the compiler typecheck it using
the command-line flag "-rectypes".

You'll certainly want to know now why this isn't standard behaviour.
Type inference of recursive types is actually neither a theoretical
problem nor an implementation difficulty (basically, I think, you just
need to drop the occurs check during type unification - please correct
me if I'm wrong).

The problem rather is that programmers can accidently write down
meaningless expressions for which the compiler infers absolutely crazy
types. If I remember correctly, OCaml already had the more general rule
by default in some ancient version, but the developers found that this
generality caused more confusion than benefits to programmers...

Regards,
Markus Mottl

-- 
Markus Mottl                                             markus@oefai.at
Austrian Research Institute
for Artificial Intelligence                  http://www.oefai.at/~markus
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2002-08-15 18:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-15  2:19 Oleg
2002-08-15 14:31 ` Michael Hicks
2002-08-15 17:26   ` Oleg
2002-08-15 18:05     ` Markus Mottl [this message]
2002-08-15 18:16       ` Brian Smith
2002-09-24 16:23     ` [Caml-list] Recursive types (Was Cyclic ?!) Christophe Raffalli
2002-08-18 16:13 ` [Caml-list] Cyclic ?! John Max Skaller

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=20020815180552.GB26027@fichte.ai.univie.ac.at \
    --to=markus@oefai.at \
    --cc=caml-list@inria.fr \
    --cc=mwh@cs.umd.edu \
    --cc=oleg_inconnu@myrealbox.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;
as well as URLs for NNTP newsgroup(s).