Skip to Content.
Sympa Menu

coq-club - Re: [Coq-Club] [Reserved Notation] and [Record]

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

Re: [Coq-Club] [Reserved Notation] and [Record]


chronological Thread 
  • From: Ian Lynagh <igloo AT earth.li>
  • To: coq-club AT inria.fr
  • Subject: Re: [Coq-Club] [Reserved Notation] and [Record]
  • Date: Sun, 14 Mar 2010 12:24:34 +0000

On Sun, Mar 14, 2010 at 08:52:24AM +0100, 
megacz AT cs.berkeley.edu
 wrote:
> Coq will let me use a notation in the definition of an inductive type:
> 
>  Reserved Notation "a &&& b" (at level 50).
>  Inductive And (A B:Prop) : Prop :=
>     conj : A -> B -> A &&& B
>  where "a &&& b" := (And a b).
> 
> ... but does not seem to let me do the same thing for a Record type:
> 
>  Reserved Notation "a &&& b" (at level 50).
>  Record And (A B:Prop) := {
>     foo : Prop -> Prop -> Prop             ;
>     conj : A -> B -> A &&& B -> Prop
>  } where "a &&& b" := (foo a b).
> 
> Is there any way to use a notation within the Record that defines terms
> used in the expansion of the Notation?

 Reserved Notation "a &&& b" (at level 50).
 Record And (A B:Prop) := {
    foo : Prop -> Prop -> Prop
        where "a &&& b" := (foo a b);
    conj : A -> B -> A &&& B -> Prop
 }.


Thanks
Ian




Archive powered by MhonArc 2.6.16.

Top of Page