caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "David Allsopp" <dra-news@metastack.com>
To: "OCaml List" <caml-list@inria.fr>
Subject: [Caml-list] Constraining mutability of record types with interfaces
Date: Thu, 20 Feb 2014 18:52:20 -0000	[thread overview]
Message-ID: <002201cf2e6c$e2696f60$a73c4e20$@metastack.com> (raw)

Is there a profound reason that I'm missing (possibly to do with
optimisations) why one can't have:

Foo.mli
	type foo = {bar : unit}

Foo.ml
	type foo = {mutable bar : unit}

i.e. have field mutability being something which can be constrained by an
interface in a sort of equivalent way to private types? I'm guessing, as the
compiler goes to the trouble of explaining the exact error, that there is!


David



             reply	other threads:[~2014-02-20 18:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-20 18:52 David Allsopp [this message]
2014-02-20 19:30 ` Gabriel Scherer

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='002201cf2e6c$e2696f60$a73c4e20$@metastack.com' \
    --to=dra-news@metastack.com \
    --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).