From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail1-relais-roc.national.inria.fr (mail1-relais-roc.national.inria.fr [192.134.164.82]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p42DnIIo020129 for ; Mon, 2 May 2011 15:49:18 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AgoEAPq1vk3VhjEVd2dsb2JhbACmHBQBDAsLBxEooymdDIYABJMSCYoB X-IronPort-AV: E=Sophos;i="4.64,302,1301868000"; d="scan'208";a="107260878" Received: from ihsmtp01cons.lis.interhost.com ([213.134.49.21]) by mail1-smtp-roc.national.inria.fr with ESMTP; 02 May 2011 15:49:12 +0200 Received: from [192.168.1.64] ([178.166.9.223]) by ihsmtp01cons.lis.interhost.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 2 May 2011 14:48:58 +0100 Message-ID: <4DBEB653.3000002@inescporto.pt> Date: Mon, 02 May 2011 14:49:07 +0100 From: Hugo Ferreira User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: caml-list users Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 02 May 2011 13:48:58.0238 (UTC) FILETIME=[AF7D51E0:01CC08CF] Subject: [Caml-list] Forcing a Map type: setting the value type Hello, I would like to make a Map with the key = int and and the value also equal to int. Is this possible? The example below does not work. TIA, Hugo F. # module Domains : Map.S with type key = int with type (+'a) t = int = Map.Make( Int );; Error: Signature mismatch: Modules do not match: sig type key = Int.t type 'a t = 'a Map.Make(Int).t val empty : 'a t val is_empty : 'a t -> bool val add : key -> 'a -> 'a t -> 'a t val find : key -> 'a t -> 'a val remove : key -> 'a t -> 'a t val mem : key -> 'a t -> bool val iter : (key -> 'a -> unit) -> 'a t -> unit val map : ('a -> 'b) -> 'a t -> 'b t val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool end is not included in sig type key = int type 'a t = int val empty : 'a t val is_empty : 'a t -> bool val add : key -> 'a -> 'a t -> 'a t val find : key -> 'a t -> 'a val remove : key -> 'a t -> 'a t val mem : key -> 'a t -> bool val iter : (key -> 'a -> unit) -> 'a t -> unit val map : ('a -> 'b) -> 'a t -> 'b t val mapi : (key -> 'a -> 'b) -> 'a t -> 'b t val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool end Type declarations do not match: type 'a t = 'a Map.Make(Int).t is not included in type 'a t = int