English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
ocamlbuild and automatic dependencies
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2007-03-17 (03:01)
From: Daniel de Rauglaudre <daniel.de_rauglaudre@i...>
Subject: Re: [Caml-list] ocamlbuild and automatic dependencies

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