caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: joelr1@gmail.com
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] ocamlbuild and automatic dependencies
Date: Fri, 16 Mar 2007 23:40:47 +0900 (JST)	[thread overview]
Message-ID: <20070316.234047.45178984.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <FEDA1DA0-0C6F-4F21-810A-E668FFE04830@gmail.com>

From: Joel Reymont <joelr1@gmail.com>

> It appears that simply copying foo.mli into foo.ml should solve the  
> issue.
> 
> I kind of hate having two identical files that I'll need to update.  
> Do I have to get used to it?
> 
> 	Thanks, Joel

But... you don't need foo.mli.
So having only foo.ml should be enough.
I know this may feel a bit strange, but in this case the essential
part is foo.ml.
Note that this is partly due to the fact foo.mli does not define a
module type, it just wraps some type definitions done in foo.ml.

An amusing alternative is to define a module type in foo.mli.

module type T = sig
  type t1 = ...
  type t2 = ...
  ...
end

Now you can define a module containing the types of Foo.T without any
implementation:

module rec FT : Foo.T = FT

Of course this only works if T contains only type definitions.

Cheers,

Jacques Garrigue 


      parent reply	other threads:[~2007-03-16 14:40 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-14 12:14 Joel Reymont
2007-03-14 12:24 ` [Caml-list] " Nicolas Pouillard
2007-03-14 12:36   ` Joel Reymont
2007-03-14 12:43     ` Nicolas Pouillard
2007-03-14 12:47       ` Joel Reymont
2007-03-14 13:11         ` Nicolas Pouillard
2007-03-14 20:11           ` skaller
2007-03-14 20:57             ` Alain Frisch
2007-03-15  3:46               ` skaller
2007-03-16 14:00           ` Joel Reymont
2007-03-16 14:22             ` Daniel de Rauglaudre
2007-03-17  0:18               ` skaller
2007-03-17  3:01                 ` Daniel de Rauglaudre
2007-03-17  8:14                 ` Alain Frisch
2007-03-17 13:52                   ` Modules for Dummies skaller
2007-03-16 14:40             ` Jacques Garrigue [this message]

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=20070316.234047.45178984.garrigue@math.nagoya-u.ac.jp \
    --to=garrigue@math.nagoya-u.ac.jp \
    --cc=caml-list@inria.fr \
    --cc=joelr1@gmail.com \
    /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).