caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: "Milan Stanojević" <milanst@gmail.com>
To: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
Cc: Hongbo Zhang <bobzhang1988@gmail.com>,
	caml-list <caml-list@yquem.inria.fr>
Subject: Re: [Caml-list] First Class modules -A bug in 4.00?
Date: Fri, 8 Jun 2012 16:25:32 -0400	[thread overview]
Message-ID: <CAKR7PS-4RpG61ZNH7HA7pJGCtgjaAj0hRNpWjwfq4O+YSPb92Q@mail.gmail.com> (raw)
In-Reply-To: <8D5E880B-79AC-45E1-B866-B83C3D725E36@math.nagoya-u.ac.jp>

On Thu, Jun 7, 2012 at 11:22 PM, Jacques Garrigue
<garrigue@math.nagoya-u.ac.jp> wrote:
> On 2012/06/08, at 11:35, Hongbo Zhang wrote:
>
>> Hi, List
>>  I am not sure this is a bug or not?
>>
>>  Below is a contrived example:
>> ------------------
>>  module type S = sig
>>    type t=int
>>    module  X : sig type u   end
>>  end
>>
>>  let f ( module X : S)  (y:X.X.u) =
>>  3
>> --------------------
>> Error: This pattern matches values of type X.X.u
>>      but a pattern was expected which matches values of type X.X.u
>>      The type constructor X.X.u would escape its scope
>> -- Thanks
>
> Definitely, this is not a bug.
> Type X.X.u is abstract, and showing it outside (as by taking an argument
> of that type) would be meaningless.

What do you mean by "abstract type" here?

For example, I'd call X.t in the following example abstract and it is
perfectly fine to use it as argument.
module X : sig type t end = struct type t = int end
let f (x : X.t) = 3

But I guess you mean something else by abstract? Is my terminology
completely wrong?

  parent reply	other threads:[~2012-06-08 20:26 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-08  2:35 Hongbo Zhang
2012-06-08  3:22 ` Jacques Garrigue
2012-06-08 15:25   ` bob zhang
2012-06-08 15:29     ` bob zhang
2012-06-08 20:25   ` Milan Stanojević [this message]
2012-06-10  9:27     ` 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-4RpG61ZNH7HA7pJGCtgjaAj0hRNpWjwfq4O+YSPb92Q@mail.gmail.com \
    --to=milanst@gmail.com \
    --cc=bobzhang1988@gmail.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=garrigue@math.nagoya-u.ac.jp \
    /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).