Version française
Home     About     Download     Resources     Contact us    
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: -- (:)
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
www
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