Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] multiple typeclass instance question

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] multiple typeclass instance question


Chronological Thread 
  • From: Jonathan Leivent <jonikelee AT gmail.com>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] multiple typeclass instance question
  • Date: Wed, 9 Mar 2016 21:44:18 -0500
  • Authentication-results: mail3-smtp-sop.national.inria.fr; spf=None smtp.pra=jonikelee AT gmail.com; spf=Pass smtp.mailfrom=jonikelee AT gmail.com; spf=None smtp.helo=postmaster AT mail-qg0-f42.google.com
  • Ironport-phdr: 9a23:W7XzQBVK7lfRJhQ+I4Fv4qrOGMXV8LGtZVwlr6E/grcLSJyIuqrYZheOt8tkgFKBZ4jH8fUM07OQ6PC/HzxfqsrQ+Fk5M7VyFDY9wf0MmAIhBMPXQWbaF9XNKxIAIcJZSVV+9Gu6O0UGUOz3ZlnVv2HgpWVKQka3CwN5K6zPF5LIiIzvjqbpq8KVM1oD2Gv1SIgxBSv1hD2ZjtMRj4pmJ/R54TryiVwMRd5rw3h1L0mYhRf265T41pdi9yNNp6BprJYYAu2pN5g/GLdfFXEtN30/zMztrxjKCwWVtVUGVWBDsB1OChTF5ReyeprwrCb8qqIp2i6cPM77Sb05cTun5qZvDhTvjXFUZHYC7GjLh5ko3+pgqxW7qkknzg==



On 03/09/2016 09:06 PM, Jason Gross wrote:
But, is there a way to have something print both foo_a and foo_b?
Axiom A : Type.
Existing Class A.
Axioms a a' : A.
Existing Instances a a'.

Class MultiA {x : A} := dummy : True.

Hint Extern 0 (@MultiA ?x) => idtac x; fail : typeclass_instances.

Goal True.
try pose (_ : MultiA).
(* a'
a
a'
a
a'
a
a'
a *)


Not sure why there's so much duplication, but can you make this work?

That's a strange solution. But, as far as I can tell, it can only print. One can't make other use of the non-most-recent instances, right? In fact, MultiA has to not have any actual instances for this to work, it seems.

-- Jonathan




Archive powered by MHonArc 2.6.18.

Top of Page