caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Constraining mutability of record types with interfaces
@ 2014-02-20 18:52 David Allsopp
  2014-02-20 19:30 ` Gabriel Scherer
  0 siblings, 1 reply; 2+ messages in thread
From: David Allsopp @ 2014-02-20 18:52 UTC (permalink / raw)
  To: OCaml List

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



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

end of thread, other threads:[~2014-02-20 19:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-20 18:52 [Caml-list] Constraining mutability of record types with interfaces David Allsopp
2014-02-20 19:30 ` Gabriel Scherer

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