Re: module aggregation

Bernd Grobauer (grobauer@boole.lmf-di.puc-rio.br)
Fri, 14 Jun 96 19:00:04 -0300

Message-Id: <9606142200.AA09807@boole.lmf-di.puc-rio.br>
From: Bernd Grobauer <grobauer@boole.lmf-di.puc-rio.br>
Date: Fri, 14 Jun 96 19:00:04 -0300
To: caml-list@pauillac.inria.fr
Subject: Re: module aggregation

--NeXT-Mail-1704375925-1
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: quoted-printable

Wolfgang Lux <lux@heidelbg.ibm.com> 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 <<lux@heidelbg.ibm.com> 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--