Browse thread
ocamlbuild and automatic dependencies
[
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: | Daniel de Rauglaudre <daniel.de_rauglaudre@i...> |
| Subject: | Re: [Caml-list] ocamlbuild and automatic dependencies |
Hi,
On Sat, Mar 17, 2007 at 11:18:26AM +1100, skaller wrote:
> So actually, this F is distinct from Foo, even though all the
> members are the same. In particular, if Foo has an abstract type t,
> is F.t the same type as Foo.t?
Yes. If you write "module F = Foo", you say : the interface and the
implementation of F are the same as the interface and the
implementation of Foo. Therefore F.t is the same type as Foo.t.
On the other hand, if you add a signature constraint, you can make
the types different :
module Foo = struct type t = A end
module F = (Foo : sig type t = A end)
let f (x : F.t) = (x : Foo.t)
^
This expression has type F.t but is here used with type Foo.t
--
Daniel de Rauglaudre
http://pauillac.inria.fr/~ddr/