From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from nez-perce.inria.fr (nez-perce.inria.fr [192.93.2.78]) by yquem.inria.fr (Postfix) with ESMTP id 7AFDBBB81 for ; Thu, 11 Nov 2004 09:37:42 +0100 (CET) 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 iAB8bfDl013491 for ; Thu, 11 Nov 2004 09:37:41 +0100 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 JAA02198 for ; Thu, 11 Nov 2004 09:37:41 +0100 (MET) Received: from mail.rsise.anu.edu.au (mail.rsise.anu.edu.au [150.203.208.4]) by nez-perce.inria.fr (8.13.0/8.13.0) with ESMTP id iAB8bbHL013479 (version=TLSv1/SSLv3 cipher=EDH-RSA-DES-CBC3-SHA bits=168 verify=NO) for ; Thu, 11 Nov 2004 09:37:40 +0100 Received: from localhost (localhost [127.0.0.1]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id B569D16570 for ; Thu, 11 Nov 2004 19:37:34 +1100 (EST) Received: from mail.rsise.anu.edu.au ([150.203.208.4]) by localhost (mail [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 15063-08 for ; Thu, 11 Nov 2004 19:37:34 +1100 (EST) Received: from pulp.anu.edu.au (pulp.rsise.anu.edu.au [150.203.208.49]) by mail.rsise.anu.edu.au (Postfix) with ESMTP id A4D2513AE2 for ; Thu, 11 Nov 2004 19:37:34 +1100 (EST) Received: by pulp.anu.edu.au (Postfix, from userid 1560) id E5DFF25B791; Thu, 11 Nov 2004 19:35:47 +1100 (EST) Date: Thu, 11 Nov 2004 19:35:47 +1100 From: Pietro Abate To: ocaml ml Subject: module type... Message-ID: <20041111083547.GA13116@pulp.anu.edu.au> Mail-Followup-To: Pietro Abate , ocaml ml Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Operating-System: GNU/Linux X-Organization: Research School of Information Science and Engineering (Australian National University) User-Agent: Mutt/1.5.6+20040907i X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at mail.rsise.anu.edu.au X-Miltered: at nez-perce with ID 419324D5.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Miltered: at nez-perce with ID 419324D1.001 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; anu:01 struct:01 val:01 sig:01 val:01 struct:01 compiler:01 functor:01 sigs:01 ...:98 ...:98 expression:01 define:01 define:01 defined:01 X-Spam-Checker-Version: SpamAssassin 3.0.0 (2004-09-13) on yquem.inria.fr X-Spam-Status: No, score=0.0 required=5.0 tests=none autolearn=disabled version=3.0.0 X-Spam-Level: Hi all, I've a problem that boils down to this code below. If I define (* -------------- *) module TermType = struct type t = int let copy t = t let to_string t = "this is a string" end ;; let l : TermType.t list = [1;2];; (* -------------- *) everything is ok. and I get val l : TermType.t list = [1; 2] but if I define: (* -------------- *) module type ElType = sig type t val copy : t -> t val to_string : t -> string end ;; module TermType : ElType = struct type t = int let copy t = t let to_string t = "this is a string" end ;; let l : TermType.t list = [1;2];; (* -------------- *) now the compiler tells me that: This expression has type int but is here used with type TermType.t but TermType.t should be unified with int... why ? I can I solve this problem ? and an other small question... why functor sigs are not defined in the std library (ie for the Set.Make module ?) thanks. p -- ++ "All great truths begin as blasphemies." -George Bernard Shaw ++ Please avoid sending me Word or PowerPoint attachments. See http://www.fsf.org/philosophy/no-word-attachments.html