Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

Browse thread
Module naming
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Andreas Rossberg <rossberg@p...>
Subject: Re: Module naming
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: -> unit end
>              ^^^^^^^^
> What I expected was that would refer to the
> type, but this doesn't seem to be the case.

You cannot even say

	type 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 just as you cannot write

	module type X = sig val one: int end
	let one =

Signatures just contain descriptions of entities - values, types,
modules, etc. - they do not contain the actual things. So there simply
is no type "" 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,

:: be declarative. be functional. just be. ::