Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: Christian RINDERKNECHT <rinderkn@hugo.int-evry.fr>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Question on typing
Date: Wed, 11 Jul 2001 21:49:42 +0200	[thread overview]
Message-ID: <20010711214942.C20109@pauillac.inria.fr> (raw)
In-Reply-To: <20010711155215.B23575@hugo.int-evry.fr>; from rinderkn@hugo.int-evry.fr on Wed, Jul 11, 2001 at 03:52:15PM +0200

> I have a question about typing, but which is not uniquely related to
> Caml. 
> Could someone tell me the reason why a type variable cannot be used as
> a type constructor, like in:
> 
> type 'a t = K of bool 'a;;
> 
> or
> 
> type 'a t = {x : 'a 'a};;

The latter is ill-sorted :-)  

> I suspect non-decidability of type inference (higher-order
> unification), but I am not an expert of that topic. Also, is type
> verification undecidable?

Type verification is decidable and not difficult; you basically get
the type system known as F_omega, which is contained as a subset in
all higher-order logical frameworks such as Coq, as well as in
Cardelli's experimental language Quest from the late 80s.

As for type inference, one could indeed fear that it involves
(undecidable) higher-order unification.  I seem to remember that it
does not, actually -- at least in the situation you outline above,
i.e. with explicit declarations of type constructors.  I'm away from
my big file of research papers at INRIA, but I believe these ideas
have been explored in Haskell ("constructor classes"), in particular
by Mark Jones, and found to be quite tractable.

- Xavier Leroy
-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


  reply	other threads:[~2001-07-11 19:49 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-11 13:52 Christian RINDERKNECHT
2001-07-11 19:49 ` Xavier Leroy [this message]
2001-07-12 13:03 ` Andreas Rossberg

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=20010711214942.C20109@pauillac.inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@inria.fr \
    --cc=rinderkn@hugo.int-evry.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