coq-club AT inria.fr
Subject: The Coq mailing list
List archive
- From: Pierre Casteran <pierre.casteran AT labri.fr>
- To: coq-club <coq-club AT inria.fr>
- Subject: [Coq-Club] Class Instances on the same type
- Date: Mon, 11 Apr 2011 17:51:31 +0200
Hello,
I define a class
Class Monoid (A:Type) : Type := {
dot : A -> A -> A;
id : A;
dot_assoc : forall x y z:A, dot x (dot y z)= dot (dot x y) z;
id_left : forall x, dot id x = x;
id_right : forall x, dot x id = x}.
and build two instances on Z of class (Monoid Z) : Z_add (additive monoid) and
Z_mult (multiplicative monoid).
Is there a simple way to specify (locally or globally) which of both instances can
be considered as the default one, when analyzing an undecorated term like for instance
fun z:Z => dot z (dot z z) ?
Pierre
- [Coq-Club] Class Instances on the same type, Pierre Casteran
- Re: [Coq-Club] Class Instances on the same type,
Matthieu Sozeau
- Re: [Coq-Club] Class Instances on the same type,
Daniel Schepler
- Re: [Coq-Club] Class Instances on the same type, Pierre Casteran
- Re: [Coq-Club] Class Instances on the same type,
Daniel Schepler
- Re: [Coq-Club] Class Instances on the same type,
Matthieu Sozeau
Archive powered by MhonArc 2.6.16.