From: Andreas Rossberg <rossberg@ps.uni-sb.de>
To: caml-list@inria.fr
Cc: Max Skaller <maxs@in.ot.com.au>
Subject: Re: Module naming
Date: Wed, 02 Feb 2000 18:58:55 +0100 [thread overview]
Message-ID: <3898705F.ABFAF927@ps.uni-sb.de> (raw)
In-Reply-To: <38978ABF.7898BDB6@in.ot.com.au>
Max Skaller wrote:
>
> I'm confused: why doesn't this work? [I get unbound type ctor message]
> [shortened version]
>
> module type X = sig type one end
> module type Y = sig type two end
> module type XY = sig module type XX = X module type YY = Y end
> module type Client = functor (T: XY) ->
> sig val f: T.XX.one -> unit end
> ^^^^^^^^
>
> What I expected was that T.XX.one would refer to the
> type X.one, but this doesn't seem to be the case.
You cannot even say
type one = X.one
What you tried is just a more complicated example of the same thing.
Signature members cannot be accessed via the dot notation - it would not
make any sense. You cannot refer to X.one just as you cannot write
module type X = sig val one: int end
let one = X.one
Signatures just contain descriptions of entities - values, types,
modules, etc. - they do not contain the actual things. So there simply
is no type "X.one" if X is a signature, the notation does not even
exist. If you want to access an actual entity you need a structure that
matches the signature X.
I'm not sure what you were trying to do, maybe you meant to say
> module type XY = sig module XX : X module YY : Y end
? With this your example should be perfectly valid.
Hope this helps,
- Andreas
--
Andreas Rossberg, rossberg@ps.uni-sb.de
:: be declarative. be functional. just be. ::
next prev parent reply other threads:[~2000-02-02 22:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-02-02 1:39 Max Skaller
2000-02-02 17:58 ` Andreas Rossberg [this message]
2000-02-02 19:20 ` Remi VANICAT
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=3898705F.ABFAF927@ps.uni-sb.de \
--to=rossberg@ps.uni-sb.de \
--cc=caml-list@inria.fr \
--cc=maxs@in.ot.com.au \
/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