Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
[Caml-list] Recursive types and functors.
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: David Brown <caml-list@d...>
Subject: [Caml-list] Recursive types and functors.
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.

Dave Brown

To unsubscribe, mail Archives:
Bug reports: FAQ:
Beginner's list: