Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: "Milan Stanojević" <milanst@gmail.com>
To: Caml List <caml-list@inria.fr>
Subject: [Caml-list] first class module types with "with type"
Date: Wed, 28 Jan 2015 18:39:16 -0500	[thread overview]
Message-ID: <CAKR7PS_FG02VNkcVB6RDJFCaThbBmi=UN0URujqD0_Cm9_GZ8g@mail.gmail.com> (raw)

My search foo is failing me, I'm pretty sure this was discussed before
but I can't find it.

Why is the following disallowed:
module type A = sig type 'a t end
type foo = { a : (module A with type 'a t = 'a list)}

File "z.ml", line 2, characters 29-30:
Error: Syntax error

But this is ok
module type A = sig type 'a t end
module type S = A with type 'a t = 'a list
type a = (module S)

If [t] is not polymorphic then I don't need intermediate module type
module type A = sig type t end
type a = (module A with type t = int)

What is going on here?

             reply	other threads:[~2015-01-28 23:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-28 23:39 Milan Stanojević [this message]
2015-01-29  2:02 ` Jacques Garrigue

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='CAKR7PS_FG02VNkcVB6RDJFCaThbBmi=UN0URujqD0_Cm9_GZ8g@mail.gmail.com' \
    --to=milanst@gmail.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