caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Module naming
@ 2000-02-02  1:39 Max Skaller
  2000-02-02 17:58 ` Andreas Rossberg
  2000-02-02 19:20 ` Remi VANICAT
  0 siblings, 2 replies; 3+ messages in thread
From: Max Skaller @ 2000-02-02  1:39 UTC (permalink / raw)
  To: caml-list

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.

-- 
John (Max) Skaller at OTT [Open Telecommications Ltd]
mailto:maxs@in.ot.com.au      -- at work
mailto:skaller@maxtal.com.au  -- at home




^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Module naming
  2000-02-02  1:39 Module naming Max Skaller
@ 2000-02-02 17:58 ` Andreas Rossberg
  2000-02-02 19:20 ` Remi VANICAT
  1 sibling, 0 replies; 3+ messages in thread
From: Andreas Rossberg @ 2000-02-02 17:58 UTC (permalink / raw)
  To: caml-list; +Cc: Max Skaller

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. ::



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Module naming
  2000-02-02  1:39 Module naming Max Skaller
  2000-02-02 17:58 ` Andreas Rossberg
@ 2000-02-02 19:20 ` Remi VANICAT
  1 sibling, 0 replies; 3+ messages in thread
From: Remi VANICAT @ 2000-02-02 19:20 UTC (permalink / raw)
  To: caml-list

Max Skaller <maxs@in.ot.com.au> writes:

> 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
>              ^^^^^^^^

i am not sure of what you want, but this work :

 module type X = sig type one end
 module type Y = sig type two end
 module type XY = sig module XX : X module YY : Y end
 module type Client = functor (T: XY) ->
   sig val f: T.XX.one -> unit end

you have define XY as the type of module that contain two module
type equal to X and to Y;

i have define XY as the type of module that contain two module of type
X and Y;

(sorry for my poor English)

version française :
Max Skaller a défini XY comme le type des modules contenant deux type
de module XX et YY égale =E0 respectivement X et Y, je pense qu'il
voulait définir XY comme le type des modules contenant deux module XX
et YY de type respectif X et Y.

--
Rémi Vanicat
vanicat@labri.u-bordeaux.fr
http://dept-info.labri.u-bordeaux.fr/~vanicat



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2000-02-02 22:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-02-02  1:39 Module naming Max Skaller
2000-02-02 17:58 ` Andreas Rossberg
2000-02-02 19:20 ` Remi VANICAT

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).