English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

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: 2002-02-08 (21:05)
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
	  module Impl : INTF = struct
	    type 'a fruit = Apple of 'a
	  type 'a fruit = 'a Impl.fruit
	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?



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