Re: polymorphic recursion

From: Simon Helsen (helsen@informatik.uni-tuebingen.de)
Date: Tue Sep 22 1998 - 17:28:45 MET DST


Date: Tue, 22 Sep 1998 17:28:45 +0200 (MST)
From: Simon Helsen <helsen@informatik.uni-tuebingen.de>
To: Pierre Weis <Pierre.Weis@inria.fr>
Subject: Re: polymorphic recursion
In-Reply-To: <199809221506.RAA17926@pauillac.inria.fr>
Message-Id: <Pine.A32.3.96.980922172125.2728W-100000@modas>

> > 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/ --



This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:16 MET