From: Bernd Grobauer <grobauer@boole.lmf-di.puc-rio.br>
To: caml-list@pauillac.inria.fr
Subject: Re: module aggregation
Date: Fri, 14 Jun 96 19:00:04 -0300 [thread overview]
Message-ID: <9606142200.AA09807@boole.lmf-di.puc-rio.br> (raw)
In-Reply-To: <9606140925.AA42640@idse.heidelbg.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 1025 bytes --]
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
[-- Attachment #2: Type: text/enriched, Size: 1072 bytes --]
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
prev parent reply other threads:[~1996-06-17 17:30 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
1996-06-13 7:09 Franck Delaplace
1996-06-14 10:25 ` Wolfgang Lux
1996-06-14 22:00 ` Bernd Grobauer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9606142200.AA09807@boole.lmf-di.puc-rio.br \
--to=grobauer@boole.lmf-di.puc-rio.br \
--cc=caml-list@pauillac.inria.fr \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox