Skip to Content.
Sympa Menu

coq-club - [Coq-Club] overloading notation

coq-club AT inria.fr

Subject: The Coq mailing list

List archive

[Coq-Club] overloading notation


chronological Thread 
  • From: Nuno Gaspar <nmpgaspar AT gmail.com>
  • To: coq-club <coq-club AT inria.fr>
  • Subject: [Coq-Club] overloading notation
  • Date: Tue, 13 Dec 2011 10:41:03 +0100

Hello.

So I would like to use the same syntactical operator for different
types. For instance,

Inductive foo : X :=
   | Cons : x -> y -> z -> foo.

And now assume that the projections are properly defined, and then

Notation "e '->x' " := (projectionX e) (at level 80, right associativity).
...

Now, I want to define another inductive, and use the same "->"
operator, but that will not work unless I explicitly use scopes.

Something like:

Notation "e '->x' " := (projectionX e) (at level 80, right
associativity) : foo_scope.

But then again, that really does not absolutely solve my problem since
now I _explicitly_ need to open/close scopes, which means that I
cannot use the intended overloaded operator "->" in the same
context...

So, how does one achieve that? :-)

thank you!







-- 
Bart: Look at me, I'm a grad student, I'm 30 years old and I made $600
dollars last year.
Marge: Bart! Don't make fun of grad students, they just made a
terrible life choice.



Archive powered by MhonArc 2.6.16.

Top of Page