[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
| Date: | -- (:) |
| From: | Bernd Grobauer <grobauer@b...> |
| Subject: | Re: module aggregation |
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 ?
>>
>
>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 =
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