From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by walapai.inria.fr (8.13.6/8.13.6) with ESMTP id p1LCefE9008723 for ; Mon, 21 Feb 2011 13:40:41 +0100 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ApwCALPrYU3RVdg0kGdsb2JhbACEH5QChgQBh34IFQEBAQEJCQwHEQQgn36JXDyCHIQpL4haAQEDBYRjdgSME4hIOg X-IronPort-AV: E=Sophos;i="4.62,200,1297033200"; d="scan'208";a="88394373" Received: from mail-qw0-f52.google.com ([209.85.216.52]) by mail4-smtp-sop.national.inria.fr with ESMTP/TLS/RC4-SHA; 21 Feb 2011 13:40:35 +0100 Received: by qwf6 with SMTP id 6so626269qwf.39 for ; Mon, 21 Feb 2011 04:40:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:date:message-id:subject:from:to :content-type; bh=1k91edd1vXr2vKZ1n2bP89oAVEG95CK7nUFjkx+oWO4=; b=AU9egANUykPlQY6gSMJaaB0Z41oxJ8Rlg9bUYY/DAqlpoHzAcuh84tODvO8idVQ5fh kCzwcdDBLcN5F023Zqo62xX2jtrNdnHXtHOWQXJ8CooT1Tipb4kU2963BNMP9eGHlMv1 ZlwPQTtVzyYo8rO/pFqsj+saflVTXZVmKkl70= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type; b=bmi+miS48ZVPS3LHoK3Ec/R/BCPAuiLSDArFatdLs+KsRlDxg6UgHuRn8QHVLo2hty ibAkoFCLRfPirMFRba1QUb8uCyyZie0NPFgAW50/z1NeMG4sHHZMkLPlTpgH2ZtCC97W Ukww/SWsHk7BFWrq2hklAGcXG3zLBqSY3DGNo= MIME-Version: 1.0 Received: by 10.229.110.10 with SMTP id l10mr927006qcp.56.1298292034012; Mon, 21 Feb 2011 04:40:34 -0800 (PST) Received: by 10.229.223.136 with HTTP; Mon, 21 Feb 2011 04:40:33 -0800 (PST) Date: Mon, 21 Feb 2011 13:40:33 +0100 Message-ID: From: Tie Cheng To: caml-list@yquem.inria.fr Content-Type: multipart/alternative; boundary=0016368321b280aa1a049cca2b8f Subject: [Caml-list] AtomMap: build a list of all the elements in a map --0016368321b280aa1a049cca2b8f Content-Type: text/plain; charset=UTF-8 Hello all, I have posted a question on Caml-beginners, but have not got response so far... guess maybe you could here... I have defined "type AT = A AtomMap.t". Do you know how to build a function "f: AT -> (atom * A) list" which returns a list of all the elements in a map? I am trying to combine AtomMap.fold, AtomMap.Iter (in this manual http://cristal.inria.fr/~fpottier/alphaCaml/alphaCaml.pdf) to do so... But it seems that unlike List.folder_left, AtomMap.fold does not accept list as argument: val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b, there it is not convenient to build a list progressively here... Thanks and regards Tie --0016368321b280aa1a049cca2b8f Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
<= div>

Hello all,

I have posted a question on Caml-beginners, but have not got response s= o far... guess maybe you could here...

I have defined "type AT = =3D A AtomMap.t". Do you know=C2=A0how to build a function "f: AT= -> (atom * A) list" which=C2=A0returns a list of all the elements = in a map?

I am trying to combine AtomMap.fold, AtomMap.Iter (in this manual=C2=A0http://cristal.inria.fr/~fpottier/alphaCaml/alphaCaml.pdf) to = do so... But=C2=A0it seems that unlike List.folder_left, AtomMap.fold does = not accept list as=C2=A0argument: val fold : (key -> 'a -> 'b= -> 'b) -> 'a t -> 'b -> 'b, there it is=C2=A0n= ot convenient to build a list progressively here...

Thanks and regards

Tie

--0016368321b280aa1a049cca2b8f--