From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on yquem.inria.fr X-Spam-Level: * X-Spam-Status: No, score=1.5 required=5.0 tests=AWL,SPF_SOFTFAIL autolearn=disabled version=3.1.3 X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id 77CDEBBAF for ; Tue, 20 Jan 2009 11:59:50 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: At8AAAg9dUnVhjEYkWdsb2JhbACUBQEBAQEJCwoHEQO3FYVz X-IronPort-AV: E=Sophos;i="4.37,295,1231110000"; d="scan'208";a="21761721" Received: from ihsmtp02voda.lis.interhost.com (HELO ihsmtp02cons.lis.interhost.com) ([213.134.49.24]) by mail3-smtp-sop.national.inria.fr with ESMTP; 20 Jan 2009 11:59:50 +0100 Received: from [192.168.1.64] ([77.54.249.136]) by ihsmtp02cons.lis.interhost.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 20 Jan 2009 10:57:09 +0000 Message-ID: <4975AEA2.6050901@inescporto.pt> Date: Tue, 20 Jan 2009 10:59:46 +0000 From: Hugo Ferreira User-Agent: Thunderbird 2.0.0.19 (X11/20090105) MIME-Version: 1.0 To: caml-list@yquem.inria.fr Subject: Making a polymorphic type non-polymorphic to comply with original signature Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 20 Jan 2009 10:57:09.0858 (UTC) FILETIME=[D7875C20:01C97AED] X-Spam: no; 0.00; sig:01 node:01 node:01 val:01 bool:01 val:01 hash:01 struct:01 hash:01 hashtbl:01 hashtbl:01 hashedtype:01 hashedtype:01 polymorphic:01 polymorphic:01 Hello, I have the following definition: module rec H : sig type 'a node = | Node of 'a node J.t | Leaf of 'a type 'a t = 'a node val equal : 'a t -> 'a t -> bool val hash : 'a t -> int end = struct type 'a node = | Node of 'a node J.t | Leaf of 'a type 'a t = 'a node let equa = (==) let hash = Hashtbl.hash end and J : Hashtbl.S with type 'a key = 'a H.node = Hashtbl.Make( H ) ;; The data type 'a node is polymorphic. It is also a key used by the hash-table. Note that H now does not comply with Hashtbl.HashedType (because Hashtbl.HashedType is not polymorphic). By adding the constraint "with type" also does not help. Is it possible to make H comply with Hashtbl.HashedType i.e: make J.Key = 'a H.node ? TIA, Hugo F.