caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Lauri Alanko <la@iki.fi>
To: caml-list@inria.fr
Subject: Unimplemented modules as top-level signatures
Date: Fri, 17 Dec 2010 11:19:50 +0200	[thread overview]
Message-ID: <20101217091950.GA28557@melkinpaasi.cs.helsinki.fi> (raw)

A minor annoyance in OCaml is that although you can (and must) put
each top-level module into its own file, there is no corresponding
mechanism for defining module types on their own: you always have to
put a "module type" definition inside another module, which
complicates scoping, and with standard tools adds an extra level of
indentation to the signature definition.

However, with 3.12 there is solution of sorts: write the signature
definition in foo.mli without an accompanying foo.ml, and then refer
to the signature as "module type of Foo".

Is this horrible style? Are there some pitfalls I should be aware of?
Or are there better solutions to my desire to avoid nested scoping?
Top-level functors would also be nice to have... :)


Lauri Alanko
la@iki.fi


             reply	other threads:[~2010-12-17  9:19 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17  9:19 Lauri Alanko [this message]
2010-12-23 15:33 ` [Caml-list] " Lukasz Stafiniak
2010-12-23 15:47   ` [Caml-list] " Sylvain Le Gall

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=20101217091950.GA28557@melkinpaasi.cs.helsinki.fi \
    --to=la@iki.fi \
    --cc=caml-list@inria.fr \
    /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).