Re: Type constraints

From: Jerome Vouillon (vouillon@clipper.ens.fr)
Date: Fri May 30 1997 - 14:17:17 MET DST


Date: Fri, 30 May 1997 14:17:17 +0200 (MET DST)
From: Jerome Vouillon <vouillon@clipper.ens.fr>
To: Ernesto Posse <mposada@impsat.net.co>
Subject: Re: Type constraints
In-Reply-To: <338DD17B.62C6@impsat.net.co>

On Thu, 29 May 1997, Ernesto Posse wrote:

> type 'a node = {x: 'a; y: t1}
> and t1 = A | B of t1*t1
> and t2 = C | D of (string * t2) node | E of bool node
>
> I obtain this message:
>
> Characters 98-102:
> This type parameter bool should be an instance of type string * t2

In the current release, in mutually recursive type definitions, all
occurrences of a type being defined (here, for instance, 'a node) must
have the same parameters.
This overly restrictive constraint will be removed in the next
release. In the meantime, as Didier Rousseau noticed, you can move
the definition of type t2 out of the recursive type definition:

    type 'a node = {x: 'a; y: t1}
    and t1 = A | B of t1*t1
    type t2 = C | D of (string * t2) node | E of bool node

-- Jerome Vouillon



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