caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Recursive types and functors.
@ 2003-03-26  6:28 David Brown
  2003-03-26  8:25 ` Jean-Christophe Filliatre
  0 siblings, 1 reply; 5+ messages in thread
From: David Brown @ 2003-03-26  6:28 UTC (permalink / raw)
  To: Caml List

I have a recursive type where I'd like one of the constructors of the
type to contain a set of the type (or something like set).  However, I
can't figure out how to represent this.

For example:

type foo =
  | Integer of int
  | String of string
  | Set of FooSet

module FooSet = Set.Make (struct type t = foo let compare = compare end)

but this obviously doesn't work.

I suspect putting type foo in a functor can somehow make it work, but I
haven't quite figure out how to do it.

Thanks,
Dave Brown

-------------------
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


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

end of thread, other threads:[~2003-03-26 15:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-03-26  6:28 [Caml-list] Recursive types and functors David Brown
2003-03-26  8:25 ` Jean-Christophe Filliatre
2003-03-26  8:57   ` David Brown
2003-03-26 15:59     ` brogoff
2003-03-26  9:13   ` Claude Marche

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).