caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Kristopher Micinski <krismicinski@gmail.com>
To: David Allsopp <dra-news@metastack.com>
Cc: OCaml List <caml-list@inria.fr>
Subject: Re: [Caml-list] Anonymous sum types in functors
Date: Mon, 24 Jun 2013 10:37:15 -0400	[thread overview]
Message-ID: <CAF1Sy-FsjPAroRxxKCpOZPsgnsk9vUVr5-H3x65frvXCjay08Q@mail.gmail.com> (raw)
In-Reply-To: <E51C5B015DBD1348A1D85763337FB6D9CC8678F2@Remus.metastack.local>

On Mon, Jun 24, 2013 at 5:39 AM, David Allsopp <dra-news@metastack.com> wrote:
> Xavier Leroy wrote:
>> On 23/06/13 09:16, David Allsopp wrote:
>> > b) Is there a syntactically lighter way to write the module definition?
>>
>> I would recommend naming your anonymous "struct":
>>
>> module Flag = struct
>>   type t = A | B
>>   let compare = compare
>>   (* Other useful operations over flags, e.g. *)
>>   let to_string = function A -> "A" | B -> "B"
>> end
>
> The "reason" for wanting to avoid that in this instance is the specific application - the sets are actually bit masks and there are about 50 of them (using a code generator, unsurprisingly). Given that the ocamldoc output is already going to be interesting, I was trying to avoid having 100 modules if possible :o)

This honestly sounds like something that you should be able to avoid
in OCamlDoc.  It seems sensible you should be able to mark things as
"don't generate documentation for these", but I havent' seen such.

Kris

  reply	other threads:[~2013-06-24 14:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-23  7:16 David Allsopp
2013-06-23 15:14 ` Xavier Leroy
2013-06-23 23:15 ` Jacques Garrigue
2013-06-24  9:39   ` David Allsopp
2013-06-24 14:37     ` Kristopher Micinski [this message]
2013-06-24 14:41       ` Raphaël Proust
2013-06-24 19:13         ` Kristopher Micinski
2013-06-25  8:39       ` David Allsopp
     [not found] <563607038852382852@orange.fr>
2013-06-23  9:48 ` David Allsopp

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=CAF1Sy-FsjPAroRxxKCpOZPsgnsk9vUVr5-H3x65frvXCjay08Q@mail.gmail.com \
    --to=krismicinski@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=dra-news@metastack.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).