Browse thread
[Caml-list] Map + Set
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Martin Jambon <martin_jambon@e...> |
| Subject: | [Caml-list] Map + Set |
Hi, I need a functional data structure that has a decent efficiency (i.e. not lists) and can represent `sets of named containers' so that I can find a container in a set, remove it from the set, update it and put it back into the set. Normally the Map module should be suitable, but it doesn't provide set operations over the keys (union, inter, diff, ...). The Set module is almost enough except that it doesn't provide a find function: val find : elt -> t -> elt (* yes! *) Finally I just copy-pasted set.mli and set.ml and inserted a find function... but is there a better solution? Martin ------------------- To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/ Beginner's list: http://groups.yahoo.com/group/ocaml_beginners