caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] exposing module types
@ 2002-02-08 21:08 Charles Martin
  2002-02-08 21:21 ` Alain Frisch
  2002-02-08 21:24 ` Daniel de Rauglaudre
  0 siblings, 2 replies; 3+ messages in thread
From: Charles Martin @ 2002-02-08 21:08 UTC (permalink / raw)
  To: caml-list

I obviously have the wrong model of what's going on here:

	% cat foolib.ml
	module Foo = struct
	  module type INTF = sig
	    type 'a fruit = Apple of 'a
	  end
	  module Impl : INTF = struct
	    type 'a fruit = Apple of 'a
	  end
	  type 'a fruit = 'a Impl.fruit
	end
	include Foo
	% ocamlc -a -o foolib.cma foolib.ml

Now, when I try to use foolib in the following way:

	open Foolib

	let apple = Apple 3
	let apple = Foo.Apple 3
	let apple = Foo.Impl.Apple 3

The only one that works is "Foo.Impl.Apple" - the others receive "Unbound constructor" messages.  I hope my intention is clear; in foolib I meant to expose the constructors at the higher levels.  What am I doing wrong?

Thanks,

Charles


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

-------------------
Bug reports: http://caml.inria.fr/bin/caml-bugs  FAQ: http://caml.inria.fr/FAQ/
To unsubscribe, mail caml-list-request@inria.fr  Archives: http://caml.inria.fr


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

end of thread, other threads:[~2002-02-08 21:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-02-08 21:08 [Caml-list] exposing module types Charles Martin
2002-02-08 21:21 ` Alain Frisch
2002-02-08 21:24 ` Daniel de Rauglaudre

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).