From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id RAA25372; Wed, 30 Jan 2002 17:46:53 +0100 (MET) 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 RAA04235 for ; Wed, 30 Jan 2002 17:46:52 +0100 (MET) Received: from nef.ens.fr (nef.ens.fr [129.199.96.32]) by nez-perce.inria.fr (8.11.1/8.11.1) with ESMTP id g0UGkov17807 for ; Wed, 30 Jan 2002 17:46:52 +0100 (MET) Received: from dmi.ens.fr (dmi.ens.fr [129.199.96.11]) by nef.ens.fr (8.10.1/1.01.28121999) with ESMTP id g0UGkjl16309 for ; Wed, 30 Jan 2002 17:46:45 +0100 (CET) Received: from basilic.ens.fr (monniaux@basilic [129.199.99.48]) by dmi.ens.fr (8.10.1/jb-1.3-180200) id g0UGkjp27598 for ; Wed, 30 Jan 2002 17:46:45 +0100 (MET) Received: from localhost (monniaux@localhost) by basilic.ens.fr (8.11.0/jb-1.1) id g0UGkh514848 for ; Wed, 30 Jan 2002 17:46:43 +0100 (MET) X-Authentication-Warning: basilic.ens.fr: monniaux owned process doing -bs Date: Wed, 30 Jan 2002 17:46:43 +0100 (MET) From: David Monniaux X-Sender: monniaux@basilic.ens.fr To: Liste CAML Subject: [Caml-list] module types and polymorphic variants Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk I tried the following: module type MT = sig type t val f: t->int end with type t = 'x constraint 'x = [> `A];; module N (M : MT) = struct type t = [M.t | `B] let f: t->int = function `B -> 1 | x -> M.f x end;; ocaml gives me: module type MT = sig type t = [> `A] val f : t -> int end but this latter definition is NOT accepted by OCaml: "Unbound type parameter [..]" The functor definition is refused because "The type M.t is not a polymorphic variant type" Is there a workaround? David Monniaux http://www.di.ens.fr/~monniaux Laboratoire d'informatique de l'École Normale Supérieure, Paris, France ------------------- 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