From: "Justin Corn" <justincorn@gmail.com>
To: caml-list@yquem.inria.fr
Subject: beginner question: DAGs w/ recursive types an encapsulation of a Map
Date: Fri, 4 May 2007 16:46:29 -0700 [thread overview]
Message-ID: <c7aa30ea0705041646q75ba495ew229aec84ead3ec2e@mail.gmail.com> (raw)
[-- 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 --]
next reply other threads:[~2007-05-04 23:46 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-05-04 23:46 Justin Corn [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=c7aa30ea0705041646q75ba495ew229aec84ead3ec2e@mail.gmail.com \
--to=justincorn@gmail.com \
--cc=caml-list@yquem.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox