Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] exposing module types
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Charles Martin <joelisp@y...>
Subject: [Caml-list] exposing module types
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