Hello,
I've been dabbling in OCaml for a few weeks now and am
quite happy
with it. I have a problem with the module system though:
making types
abstract is easy and often useful, but sometimes I just want
to have
the type declaration public and exported. How can I do that?
Let's say I have an interface file that contains
type t = { id: int }
I've tried putting all sorts of things into the
implementation file,
from nothing at all to just "type t", repeating
the full declaration
and referencing the interface type (like "type t =
Interface.t", where
Interface obviously is the correct module name), but nothing
worked as
expected. My current workaround is to put the type
declaration into a
separate .ml file without interface file, but that seems
like an ugly
workaround. What's the right way?
Thanks,
Clemens
------------------------ Yahoo! Groups Sponsor
--------------------~-->
Get to your groups with one click. Know instantly when new
email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/yQLSAA/saFolB/TM
------------------------------------------------------------
--------~->
Archives up to August 22, 2005 are also downloadable at http://www.connettivo.net/cntprojects/ocaml_beginners/
The archives of the very official ocaml list (the seniors'
one) can be found at http://caml.inria.fr
Attachments are banned and you're asked to be polite, avoid
flames etc.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http:/
/groups.yahoo.com/group/ocaml_beginners/
<*> To unsubscribe from this group, send an email to:
ocaml_beginners-unsubscribe@yahoogroups.com
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.c
om/info/terms/
|