caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Unimplemented modules as top-level signatures
@ 2010-12-17  9:19 Lauri Alanko
  2010-12-23 15:33 ` [Caml-list] " Lukasz Stafiniak
  0 siblings, 1 reply; 3+ messages in thread
From: Lauri Alanko @ 2010-12-17  9:19 UTC (permalink / raw)
  To: caml-list

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-12-23 15:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-17  9:19 Unimplemented modules as top-level signatures Lauri Alanko
2010-12-23 15:33 ` [Caml-list] " Lukasz Stafiniak
2010-12-23 15:47   ` [Caml-list] " Sylvain Le Gall

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).