From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA03068 for caml-redistribution; Tue, 22 Sep 1998 18:18:37 +0200 (MET DST) Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id RAA11301 for ; Tue, 22 Sep 1998 17:28:50 +0200 (MET DST) Received: from macon.informatik.uni-tuebingen.de (macon2.Informatik.Uni-Tuebingen.De [134.2.13.2]) by nez-perce.inria.fr (8.8.7/8.8.7) with ESMTP id RAA25873; Tue, 22 Sep 1998 17:28:48 +0200 (MET DST) Received: from modas.informatik.uni-tuebingen.de (modas.Informatik.Uni-Tuebingen.De [134.2.12.3]) by macon.informatik.uni-tuebingen.de (8.9.1/8.9.1) with SMTP id RAA14444; Tue, 22 Sep 1998 17:28:48 +0200 Received: from localhost by modas.informatik.uni-tuebingen.de (AIX 4.1/UCB 5.64/4.03) id AA23566; Tue, 22 Sep 1998 17:28:46 +0200 Date: Tue, 22 Sep 1998 17:28:45 +0200 (MST) From: Simon Helsen X-Sender: helsen@modas To: Pierre Weis Cc: caml-list@inria.fr Subject: Re: polymorphic recursion In-Reply-To: <199809221506.RAA17926@pauillac.inria.fr> Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: weis > > I don't know why Caml allows more general type constraints, but it might > > be a good idea to follow SML on this matter (and I am interested to know > > if there are good reasons for not doing this) > > If we use it to get polymorphic recursion, there is a good reason to > do this. right, but there is no polymorphic recursion in Ocaml, is there? > Another problem is the scope of type variables in type > constraints. What's the meaning of > > let f (x : 'a) (y : 'a) = y;; > > We may need explicit Forall keywords to express type schemes in constraints. Indeed, this is a problem. Standard ML solves this by defining some explicit rules for free type variables (section 4.6 of the definition - p18) But, admitted, it's ugly and difficult. It would probably be better to forbid free variables in type constraints altogether. Simon ----------------------- Simon Helsen ------------------------ -- Wilhelm-Schickard-Institut fuer Informatik -- -- Arbeitsbereich Programmierung (PU) -- -- Universitaet Tuebingen, Germany -- ------------------------------------------------------------- -- http://www-pu.informatik.uni-tuebingen.de/users/helsen/ --