From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p42Ekkkw022743 for ; Mon, 2 May 2011 16:46:46 +0200 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AogCAAbDvk3RVda2kGdsb2JhbACmFAgUAQEBAQkJDQcUBCGmFo0mhBGJEgEBAwaFegSOeYo6O4Ejggw X-IronPort-AV: E=Sophos;i="4.64,303,1301868000"; d="scan'208";a="82174387" Received: from mail-iw0-f182.google.com ([209.85.214.182]) by mail3-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 02 May 2011 16:46:40 +0200 Received: by iwn33 with SMTP id 33so8683453iwn.27 for ; Mon, 02 May 2011 07:46:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:in-reply-to:references:from :date:x-google-sender-auth:message-id:subject:to:cc:content-type; bh=/gCcw5k2LWSg03WPfwQBEbPwcOIk4qotIIQFUlYBcnk=; b=nTeRhmfP/H4zulxVsup6wS3Tqk+h56nqWq+nhpr2xv4M6BY9ykAnLNffWDg7pNv20q FfXj/4tFCYYDf07MqcTDxLSWz0f0kOP/tx+z4D5vKr9VAboAKypYImJg4+o4W+ppmVCq jv2FuVYTK3rFUd9Owz9YPpWv3V7cEh5qmZ//A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:from:date :x-google-sender-auth:message-id:subject:to:cc:content-type; b=mEOzyLai51/w695iULTeQHAUIKJmtcOE1q4N30xCvPTGxHJ0Noac+oy4voOgPRjf29 oR0fuOnzCTK/Ofz+dFhiZDgZxx36HUrTdmEFNwpJOEOPl5dFNXtYR6OMDeN0DCAF6N36 tGQUfALqSEFfS9NETX8djtaqOyZ5ICWgXHgNs= Received: by 10.231.180.25 with SMTP id bs25mr6432784ibb.151.1304347599117; Mon, 02 May 2011 07:46:39 -0700 (PDT) MIME-Version: 1.0 Sender: david.mentre@gmail.com Received: by 10.231.190.5 with HTTP; Mon, 2 May 2011 07:46:09 -0700 (PDT) In-Reply-To: <4DBEBD4A.7070406@inescporto.pt> References: <4DBEB653.3000002@inescporto.pt> <4DBEBD4A.7070406@inescporto.pt> From: David MENTRE Date: Mon, 2 May 2011 16:46:09 +0200 X-Google-Sender-Auth: BwUEuyQI-5wn2-xBlEuOfzk7xNM Message-ID: To: Hugo Ferreira Cc: =?ISO-8859-1?Q?=C7agdas_Bozman?= , caml-list users Content-Type: text/plain; charset=ISO-8859-1 Subject: Re: [Caml-list] Forcing a Map type: setting the value type Hello Hugo, 2011/5/2 Hugo Ferreira : > Maybe I did not express myself correctly. > The above would also work with any other type for the > parameter 'a. I want only integers for it. So: > > # let m = IntMap.empty;; Just do: # let m : int IntMap.t = IntMap.empty;; The " : int IntMap.t" type annotation restricts the default "'a IntMap.t" of IntMap.empty. > # let m = IntMap.add 1 "42" m;; Then: # let m = IntMap.add 1 "42" m;; Characters 26-27: let m = IntMap.add 1 "42" m;; ^ This expression has type int IntMap.t but is here used with type string IntMap.t Best regards, david