Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] Module Include leads to duplicate type class instances

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] Module Include leads to duplicate type class instances


Chronological Thread 
  • From: Ralf Jung <jung AT mpi-sws.org>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] Module Include leads to duplicate type class instances
  • Date: Thu, 15 Dec 2016 22:27:56 +0100
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=jung AT mpi-sws.org; spf=Pass smtp.mailfrom=jung AT mpi-sws.org; spf=None smtp.helo=postmaster AT hera.mpi-klsb.mpg.de
  • Ironport-phdr: 9a23:oT3TEBQUDwWYIJxBOIwA1Qv/jdpsv+yvbD5Q0YIujvd0So/mwa67YhCN2/xhgRfzUJnB7Loc0qyN4vumBz1LvMvJ8ChbNscTB1ld0YRetjdjKfDGIHWzFOTtYS0+EZYKf35e1Fb/D3JoHt3jbUbZuHy44G1aMBz+MQ1oOra9QdaK3Izkn9y1rpbUekBDgCe3SbJ0NhS/6wvL5ecMho43EK81xFPrv31HM7BU2GVnDVeLnlPn+dz2+4RspXcD88k9/tJNBP2pN58zSqZVWWwr

Hi,

On 13.12.2016 17:33, Jason Gross wrote:
> I would call this a misfeature or a known design issue. There is a
> similar issue with module functor application.
>
> If you just want namespacing, try this module structure instead:
>
> Module Export foo1.
> Module bar. ... End bar.
> End foo1.
>
> Module Export foo2.
> Module bar. ... End bar.
> End foo2.
>
> ...
>
> If you also want [Import bar] to do the right thing, you can create
> another module [bar] which [Export]s all of the inner modules [bar].

So when a module Exports multiple modules with the same name, they
somehow get magically merged? That's scary.

I thought then when I write "X.foo", Coq first finds module "X" and then
looks for symbol "foo" in it. But with the merging witnessed above, it
seems like it's actually searching for "X.foo" in one go, and there
could be multiple modules X that it is checking here?

Kind regards,
Ralf



Archive powered by MHonArc 2.6.18.

Top of Page