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: Matthieu Sozeau <mattam AT mattam.org>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] multiple typeclass instance question
  • Date: Thu, 10 Mar 2016 01:05:10 +0000
  • Authentication-results: mail2-smtp-roc.national.inria.fr; spf=None smtp.pra=mattam AT mattam.org; spf=Pass smtp.mailfrom=matthieu.sozeau AT gmail.com; spf=None smtp.helo=postmaster AT mail-wm0-f50.google.com
  • Ironport-phdr: 9a23:8zYi+hyD/hVTtGXXCy+O+j09IxM/srCxBDY+r6Qd0ekQIJqq85mqBkHD//Il1AaPBtWEraIbwLCG+4nbGkU+or+5+EgYd5JNUxJXwe43pCcHRPC/NEvgMfTxZDY7FskRHHVs/nW8LFQHUJ2mPw6anHS+4HYoFwnlMkItf6KuStGU35v8jbD60qaQSjsLrQL1Wal1IhSyoFeZnegtqqwmFJwMzADUqGBDYeVcyDAgD1uSmxHh+pX4p8Y7oGwD884mosVHSODxe7kyZb1eFjUvdW4vt+PxshyWaAKT+nsdX3heqR1aDgHYpEX/V4vtuy7Ss+NhxCCfe8rsQuZnCnyZ8653RUqw2288PDkj/TSPhw==

You are basically asking for putting the pretyper in the tactic monad
here, so that refine could return multiple successes, right? 
I think Arnaud had some ideas about this.
-- Matthieu

On Thu, Mar 10, 2016 at 1:08 AM Jonathan Leivent <jonikelee AT gmail.com> wrote:
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