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 KAA29444; Tue, 4 Feb 2003 10:53:17 +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 KAA28974 for ; Tue, 4 Feb 2003 10:53:16 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.11.1/8.11.1) with ESMTP id h149nif26401; Tue, 4 Feb 2003 10:49:44 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id KAA29407; Tue, 4 Feb 2003 10:49:41 +0100 (MET) Date: Tue, 4 Feb 2003 10:49:41 +0100 From: Xavier Leroy To: Mike Potanin Cc: caml-list@inria.fr Subject: Re: [Caml-list] Generic generic types. Message-ID: <20030204104941.A29233@pauillac.inria.fr> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 1.0i In-Reply-To: ; from potanin@mccme.ru on Mon, Feb 03, 2003 at 06:26:12PM +0300 Sender: owner-caml-list@pauillac.inria.fr Precedence: bulk > Haskell support types like > > data Refal_atom agregat = RefalChar Char > | RefalInt Int > | RefalTerm (agregat (Refal_atom agregat)) These are called higher-order type constructors: Refal_atom is parameterized not by a simple type, but by a type constructor (a function from types to types). > Do OCaml support similar type? Not in the core language, but you can achieve similar effect with functors: module M(A: sig type 'a agregat end) = struct type refal_atom = Char of char | Int of int | Term of refal_atom A.agregat end Hope this answers your question, - Xavier Leroy ------------------- 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