From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from majordomo@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id HAA31079; Wed, 26 Mar 2003 07:28:58 +0100 (MET) X-Authentication-Warning: pauillac.inria.fr: majordomo set sender to owner-caml-list@pauillac.inria.fr using -f Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id HAA31043 for ; Wed, 26 Mar 2003 07:28:57 +0100 (MET) X-SPAM-Warning: Sending machine is listed in blackholes.five-ten-sg.com Received: from opus.davidb.org (66-75-152-1.san.rr.com [66.75.152.1]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h2Q6Suf20334 for ; Wed, 26 Mar 2003 07:28:56 +0100 (MET) Received: from davidb by opus.davidb.org with local (Exim 3.31 #1 (Debian)) id 18y4P8-0003wD-00 for ; Tue, 25 Mar 2003 22:28:54 -0800 Date: Tue, 25 Mar 2003 22:28:54 -0800 From: David Brown To: Caml List Subject: [Caml-list] Recursive types and functors. Message-ID: <20030326062854.GA15098@opus.davidb.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4i X-Spam: no; 0.00; caml-list:01 functors:01 foo:01 struct:01 functor:01 int:01 constructors:01 module:03 string:03 dave:03 recursive:03 types:03 let:04 suspect:05 integer:06 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk 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