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
[Caml-list] Exported Types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2002-06-26 (17:16)
From: Nicolas Cannasse <warplayer@f...>
Subject: [Caml-list] Exported Types
I got some problem using an "exported type" ( shared between modules ).
I know that I can avoid them by using polymorphic types but that'ld be nicer
without them.
I would also like of course to keep the files separated.

Here's a sample :

-- a.mli ---
type t (* exported *)

-- b.mli --
type t
val f : A.t -> t (* module B is using the type A.t but won't directly call
any A functions *)

-- b.ml --
type t = A.t (* quite stupid , but that's a sample ! *)
let f x = x

-- a.ml --
type t = int;;
ignore( B.f  (0:t) )
(* This expression has type t = int but is here used with type A.t *)

I think this problem is quite standard, but I didn't find any clue on the
Any help will be welcomed

Nicolas Cannasse

To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners