Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* beginner question: DAGs w/ recursive types an encapsulation of a Map
@ 2007-05-04 23:46 Justin Corn
  2007-05-05  0:59 ` [Caml-list] " Gabriel Kerneis
  2007-05-05  7:10 ` Jean-Christophe Filliatre
  0 siblings, 2 replies; 7+ messages in thread
From: Justin Corn @ 2007-05-04 23:46 UTC (permalink / raw)
  To: caml-list

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

Dear all,

I'm trying to construct a tree (for the Aho-Corasick exact match algorithm)
but I can't quite figure out how to do this.

1) Is it possible to declare a recursive type that would allow for a tree
having an arbitrarily large number of children per node?

I couldn't figure that one out, so I was thinking I could use a Map
collection to represent edges.

2) How do you wrap a Map in an object or record?  In my case the edges
represent single characters, so I started with

#module CharMap = Map.Make(Char);;

but then the top level was not happy with

#type node = { a: int; b: CharMap.t };;

3) If there are preexisting graphical libraries for ocaml, maybe I should
just use those, but after searching a bit I was unable to find any.  Does
someone know where I could find one?

Thanks,
Justin

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

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

end of thread, other threads:[~2007-05-06  8:05 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-05-04 23:46 beginner question: DAGs w/ recursive types an encapsulation of a Map Justin Corn
2007-05-05  0:59 ` [Caml-list] " Gabriel Kerneis
2007-05-06  3:33   ` Pablo Polvorin
2007-05-06  3:39     ` Jon Harrop
2007-05-06  7:54       ` Alain Frisch
2007-05-06  8:05         ` skaller
2007-05-05  7:10 ` Jean-Christophe Filliatre

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