From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id A5CFABB81 for ; Mon, 24 Oct 2005 16:05:28 +0200 (CEST) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id j9OE5Sgj004830 for ; Mon, 24 Oct 2005 16:05:28 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id QAA32316 for ; Mon, 24 Oct 2005 16:05:27 +0200 (MET DST) Received: from cenn.mc.mpls.visi.com (cenn.mc.mpls.visi.com [208.42.156.9]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id j9OE5QlQ008984 for ; Mon, 24 Oct 2005 16:05:27 +0200 Received: from [192.168.42.2] (bhurt.dsl.visi.com [208.42.141.66]) by cenn.mc.mpls.visi.com (Postfix) with ESMTP id BEA70818B; Mon, 24 Oct 2005 09:05:25 -0500 (CDT) Date: Mon, 24 Oct 2005 09:08:05 -0500 (CDT) From: Brian Hurt X-X-Sender: bhurt@localhost.localdomain To: Keiko Nakata Cc: caml-list@inria.fr Subject: Re: [Caml-list] any types in signatures of functor arguments In-Reply-To: <20051024.175154.68545642.keiko@kurims.kyoto-u.ac.jp> Message-ID: References: <20051024.175154.68545642.keiko@kurims.kyoto-u.ac.jp> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Miltered: at nez-perce with ID 435CEA28.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at concorde with ID 435CEA26.000 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; caml-list:01 functor:01 functor:01 concretely:01 typable:01 sig:01 val:01 struct:01 ocaml:01 sig:01 val:01 struct:01 2005,:98 wrote:01 signatures:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.3 On Mon, 24 Oct 2005, Keiko Nakata wrote: > Hello. > > Why I cannot have *any types* in signatures of functor arguments? > Concretely, the following F is not typable. > > module F(X:sig type t = [`A of _ ] val f : t -> int end) = > struct > let f = function `A x as a -> X.f a | `B -> 0 > end I think the problem is that `A holds something, but you're not giving Ocaml any idea of what. For example, the following compiles: module F(X:sig type 'a t = [`A of 'a ] val f : 'a t -> int end) = struct let f = function `A x as a -> X.f a | `B -> 0 end Hope this helps. Brian