More confusion with mutually recursive type definitions

From: Francois Pottier (Francois.Pottier@inria.fr)
Date: Mon Aug 16 1999 - 09:51:18 MET DST


Date: Mon, 16 Aug 1999 09:51:18 +0200
From: Francois Pottier <Francois.Pottier@inria.fr>
To: Jacques GARRIGUE <garrigue@kurims.kyoto-u.ac.jp>
Subject: More confusion with mutually recursive type definitions
In-Reply-To: <19990816160801Q.garrigue@kurims.kyoto-u.ac.jp>; from Jacques GARRIGUE on Mon, Aug 16, 1999 at 04:08:01PM +0900

> But if it is yet to be defined (which is the case with mutually
> recursive definitions), you must keep everything monomorphic so that
> constraints can be enforced later.

OK, so I understand the following error message:

  # type 'a t = 'a and u = int t and v = bool t;;
  This type bool should be an instance of type int

But then, why is the following declaration accepted?

  # type 'a t = 'a and u = A of int t and v = B of bool t;;
  type 'a t = 'a
  type u = | A of int t
  type v = | B of bool t

I am still confused...

-- 
François Pottier
Francois.Pottier@inria.fr
http://pauillac.inria.fr/~fpottier/



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