caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Sam Steingold <sds@gnu.org>
To: caml-list@inria.fr
Subject: functor troubles
Date: Mon, 03 Mar 2008 10:40:22 -0500	[thread overview]
Message-ID: <47CC1BE6.2060408@gnu.org> (raw)

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

It appears that module functor arguments are needlessly duplicated:

============================================
module A1 = struct
~  module F (M: sig end) = struct
~    type t = T
~  end
~  module I = struct end
~  module M = F (I)
end

module A2 = A1

let f : A1.M.t -> A2.M.t = fun x -> x
============================================

This expression has type A1.M.t = A1.F(A1.I).t but is here used with
type A2.M.t = A1.F(A2.I).t

when I replace "module M = F (I)" with "module M = F (struct end)" it works.

Note that the whole file invokes the functor F precisely once, so it is
not clear why type A2.M.t is defined in terms of F and not as identical
to A1.M.t.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFHzBvmPp1Qsf2qnMcRApMkAJ9OJEfpRk1eKxce3HsZfHapqKKnwQCglT04
ZNXh7XxnQRwz1XjZzTO9wnI=
=3TuW
-----END PGP SIGNATURE-----


             reply	other threads:[~2008-03-03 15:40 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-03 15:40 Sam Steingold [this message]
2008-03-03 17:15 ` [Caml-list] " Keiko Nakata

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=47CC1BE6.2060408@gnu.org \
    --to=sds@gnu.org \
    --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).