caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Martin DeMello <martindemello@gmail.com>
To: Goswin von Brederlow <goswin-v-b@web.de>
Cc: "caml-list@inria.fr" <caml-list@inria.fr>
Subject: Re: [Caml-list] "subclassing" a char map
Date: Mon, 16 Sep 2013 14:09:46 -0700	[thread overview]
Message-ID: <CAFrFfuEmVFq5CNECc_fW4tQupGSyfyoLHd7hShLYVeinbkLRjQ@mail.gmail.com> (raw)
In-Reply-To: <20130916074218.GB9309@frosties>

On Mon, Sep 16, 2013 at 12:42 AM, Goswin von Brederlow
<goswin-v-b@web.de> wrote:
>
> I recommend using a private type (in the module type) over an abstract
> one:
>     type t = private char
>
> That way a type t instance can only be constructed in the module,
> where you check the upper case, but can be used in place of a char
> otherwise. No need to manually project it everywhere.

Thanks, didn't know about that feature at all. After a bit of googling
I found https://ocaml.janestreet.com/?q=node/77, which is a nice write
up on the subject.

martin

  reply	other threads:[~2013-09-16 21:09 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-15 22:29 Martin DeMello
2013-09-16  4:20 ` Ivan Gotovchits
2013-09-16  4:31   ` Martin DeMello
2013-09-16  7:42     ` Goswin von Brederlow
2013-09-16 21:09       ` Martin DeMello [this message]
2013-09-17  8:13     ` oleg

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=CAFrFfuEmVFq5CNECc_fW4tQupGSyfyoLHd7hShLYVeinbkLRjQ@mail.gmail.com \
    --to=martindemello@gmail.com \
    --cc=caml-list@inria.fr \
    --cc=goswin-v-b@web.de \
    /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).