Version française
Home     About     Download     Resources     Contact us    

This site is updated infrequently. For up-to-date information, please visit the new OCaml website at

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
	module Foo = struct
	  module type INTF = sig
	    type 'a fruit = Apple of 'a
	  module Impl : INTF = struct
	    type 'a fruit = Apple of 'a
	  type 'a fruit = 'a Impl.fruit
	include Foo
	% ocamlc -a -o foolib.cma

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?



Do You Yahoo!?
Get your free address at

Bug reports:  FAQ:
To unsubscribe, mail  Archives: