Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* [Caml-list] Exported Types
@ 2002-06-26 17:15 Nicolas Cannasse
  2002-06-27  6:45 ` Jacques Garrigue
  0 siblings, 1 reply; 2+ messages in thread
From: Nicolas Cannasse @ 2002-06-26 17:15 UTC (permalink / raw)
  To: OCaml

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


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-06-27  6:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-26 17:15 [Caml-list] Exported Types Nicolas Cannasse
2002-06-27  6:45 ` Jacques Garrigue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox