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 19:08:26 -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-f43.google.com
  • Ironport-phdr: 9a23:g7pOaRfGIWAolg1lx7R3g0+/lGMj4u6mDksu8pMizoh2WeGdxc6/Zx7h7PlgxGXEQZ/co6odzbGG7OawBidZu96oizMrTt9lb1c9k8IYnggtUoauKHbQC7rUVRE8B9lIT1R//nu2YgB/Ecf6YEDO8DXptWZBUiv2OQc9HOnpAIma153xjLDtvc2MKFwSzBOGIppMbzyO5T3LsccXhYYwYo0Q8TDu5kVyRuJN2GlzLkiSlRuvru25/Zpk7jgC86l5r50IZ4yhIP99FeAQTGl+cjN92Mq+vh7aCACL+3E0U2MMkxMODRKWwgv9W8LTtS3zqup03mG+MMzoQLYoEWCg6KFqSxLshSovODsw8WWRgct12vEI6Cm9rgByltaHKLqeM+BzK/6FcA==

I meant something more like this:

Class Foo : Type.

Instance foo_a : Foo.

Instance foo_b : Foo.

Goal True.
try (refine (let x := _ : Foo in _);
let y := eval unfold x in x in idtac y; fail).

The above prints only foo_b, because that is the most recent definition (since their costs are the same). Using costs, one can make it so that foo_a is printed, but not foo_b. But, is there a way to have something print both foo_a and foo_b?

-- Jonathan

On 03/09/2016 06:49 PM, Vadim Zaliva wrote:
How about something like this:

Instance Zmult_op : monoid_binop Z | 1 := Zmult.
Instance Zplus_op : monoid_binop Z | 2 := Zplus.

(from
http://www.labri.fr/perso/casteran/CoqArt/TypeClassesTut/typeclassestut.pdf
)

Vadim

--
CMU ECE PhD candidate
Mobile: +1(510)220-1060
Skype: vzaliva


On Wed, Mar 9, 2016 at 1:38 PM, Jonathan Leivent
<jonikelee AT gmail.com>
wrote:

Suppose one has multiple typeclass instances of the same exact class (same
exact parameterization). Is there a way to get to more of them other than
just the most recently declared one with the highest priority?

-- Jonathan






Archive powered by MHonArc 2.6.18.

Top of Page