From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: weis Received: (from weis@localhost) by pauillac.inria.fr (8.6.10/8.6.6) id TAA03161 for caml-redistribution; Mon, 17 Jun 1996 19:30:57 +0200 Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.6.10/8.6.6) with ESMTP id XAA01765 for ; Fri, 14 Jun 1996 23:52:48 +0200 Received: from boole.lmf-di.puc-rio.br (boole.lmf-di.puc-rio.br [139.82.71.62]) by concorde.inria.fr (8.7.1/8.7.1) with SMTP id XAA21233 for ; Fri, 14 Jun 1996 23:52:44 +0200 (MET DST) Received: by boole.lmf-di.puc-rio.br (NX5.67f2/NX3.0M) id AA09807; Fri, 14 Jun 96 19:00:05 -0300 Message-Id: <9606142200.AA09807@boole.lmf-di.puc-rio.br> Mime-Version: 1.0 (NeXT Mail 3.3risc v118.3) Content-Type: multipart/alternative; boundary=NeXT-Mail-1704375925-1 Content-Transfer-Encoding: 7bit Received: by NeXT.Mailer (1.118.3) From: Bernd Grobauer Date: Fri, 14 Jun 96 19:00:04 -0300 To: caml-list@pauillac.inria.fr Subject: Re: module aggregation References: <9606140925.AA42640@idse.heidelbg.ibm.com> Sender: weis --NeXT-Mail-1704375925-1 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Wolfgang Lux writes: > >> I want to aggregate two modules in one in order >> to improve some standard modules or some module >> define by functors . How can I do this in Ocaml ?=20 >>=20 > >This answer is very simple: You cannot. > >The only way to achieve your goal would be to define a new = module, >copy all values of the module M1 you want to preserve and then = add or >change those values which you do not want to include from M1 or = add to >M1. Some time ago I was wondering about something kind of equivalent = to this problem, regarding module types: including an already defined module type in order to keep = module types more readable, instead of copying all the definitions already made. = For example in ML I could write something like module type ExtendedList =3D sig include ListType split:: ('a -> boole) -> 'a list -> 'alist * 'alist end;; There is no such thing include in the OCAML-language. Is this = because it is incompatible with the type system? Bernd --NeXT-Mail-1704375925-1 Content-Type: text/enriched; charset=us-ascii Content-Transfer-Encoding: quoted-printable Wolfgang Lux < writes: > >> I want to aggregate two modules in one in order >> to improve some standard modules or some module >> define by functors . How can I do this in Ocaml ?=20 >>=20 > >This answer is very simple: You cannot. > >The only way to achieve your goal would be to define a new = module, >copy all values of the module M1 you want to preserve and then = add or >change those values which you do not want to include from M1 or = add to >M1. Some time ago I was wondering about something kind of equivalent = to this problem, regarding module types: including an already defined module type in order to keep = module types more readable, instead of copying all the definitions already made. = For example in ML I could write something like module type ExtendedList =3D sig include ListType split:: ('a -> boole) -> 'a list -> 'alist * 'alist end;; There is no such thing include in the OCAML-language. Is this = because it is incompatible with the type system? Bernd --NeXT-Mail-1704375925-1--