caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Chris King" <colanderman@gmail.com>
To: "Felix Dorner" <felix_do@web.de>
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] How to expose sum type constructors to an interface
Date: Wed, 17 Oct 2007 20:41:42 -0400	[thread overview]
Message-ID: <875c7e070710171741k53c0f57due3d84fc3efc33733@mail.gmail.com> (raw)
In-Reply-To: <4716A5F2.9090708@web.de>

On 10/17/07, Felix Dorner <felix_do@web.de> wrote:
> although this might really be a beginner´ s question I´ ll post it here
> and risk to be eaten by the big fish around here...

Well, this small fish is going to nudge you in the direction of the
O'Caml beginners list
(http://tech.groups.yahoo.com/group/ocaml_beginners/) for future
"beginner" questions :)

> In my implementation file module.ml I define: type aType = A | B
> How I now need to expose this Type and its constructors to the
> interface  module.mli, because some of the functions declared in the
> interface take a parameter of type "aType". How can I do this?

Just add "type aType = A | B" to the module.mli file.  As a side note,
if you ever want to see what the inferred signature (i.e. the
signature of a .ml with no .mli) of a module is, run ocaml -i on the
.ml file and it will spit the inferred .mli to standard output.

HTH,
Chris


  reply	other threads:[~2007-10-18  0:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-18  0:16 Felix Dorner
2007-10-18  0:41 ` Chris King [this message]
2007-10-18  0:45 ` [Caml-list] " Julien Moutinho
2007-10-18  5:48   ` Christophe Raffalli

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=875c7e070710171741k53c0f57due3d84fc3efc33733@mail.gmail.com \
    --to=colanderman@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=felix_do@web.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).