Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] AtomMap: build a list of all the elements in a map
@ 2011-02-21 12:40 Tie Cheng
  2011-02-21 12:44 ` David Allsopp
  2011-02-21 13:05 ` Raphael Proust
  0 siblings, 2 replies; 3+ messages in thread
From: Tie Cheng @ 2011-02-21 12:40 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 651 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 975 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-02-21 13:05 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-21 12:40 [Caml-list] AtomMap: build a list of all the elements in a map Tie Cheng
2011-02-21 12:44 ` David Allsopp
2011-02-21 13:05 ` Raphael Proust

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox