caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Style and organization of code
@ 2007-03-14 22:25 ian
  2007-03-15  3:21 ` [Caml-list] " Tom
                   ` (5 more replies)
  0 siblings, 6 replies; 20+ messages in thread
From: ian @ 2007-03-14 22:25 UTC (permalink / raw)
  To: caml-list

I'm looking for a guidebook or just some rules of thumb on how to organize my
OCaml code.

One example:

Say I have a function called "solveHardProblem".   solveHardProblem relies on
several helper functions, which are not going to be useful to any other
functions in the program.  So, my first instinct would be to define all the
helpers using let blocks within the definition of solveHardProblem.

But that would make the definition of solveHardProblem really long -- several
screens of text -- which I've been taught to avoid.  Is it wrong to use a module
to hide those functions if the module signature will contain only that of
solveHardProblem?

And say you DO choose to use a module...  The OCaml documentation says that the
compiler can automatically infer the signature without the need to create a .mli
file for it.  Does anyone actually use that feature in practice, or is creating
a sig hard-wired to the act of creating a struct?

Thanks,
-Ian


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

end of thread, other threads:[~2007-03-29  1:52 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-14 22:25 Style and organization of code ian
2007-03-15  3:21 ` [Caml-list] " Tom
2007-03-15  1:03   ` ian
2007-03-15  8:02     ` Gabriel Kerneis
2007-03-15  8:09       ` Maxence Guesdon
2007-03-15  8:20         ` Gabriel Kerneis
2007-03-15 10:11           ` ian
2007-03-15 20:04             ` Martin Jambon
2007-03-15  3:44 ` Chris King
2007-03-15  3:50   ` Chris King
2007-03-15  4:01 ` skaller
2007-03-15  9:03   ` micha
2007-03-15 13:38 ` dynamically finding libraries Vu Ngoc San
2007-03-15 17:10   ` [Caml-list] " Eric Cooper
2007-03-15 17:29     ` slightly OT: anyone reading this list with Mutt? Eric Cooper
2007-03-15 18:44       ` [Caml-list] " Stefano Zacchiroli
2007-03-15 19:00       ` caml-list
2007-03-15 19:44         ` ls-ocaml-developer-2006
2007-03-15 22:39 ` [Caml-list] Style and organization of code Richard Jones
2007-03-29  0:49 ` Jon Harrop

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