Parameter P : Type -> Type -> Type -> Type. Notation"e |= t --> v" := (P e t v) (at level 100, t at level 54). Check (nat |= nat --> nat).
(* Check that first non empty definition at an empty level can be of any
associativity *)
ModuleType v1. Notation"x +1" := (S x) (at level 8, left associativity). End v1. ModuleType v2. Notation"x +1" := (S x) (at level 8, right associativity). End v2.
(* Check that empty levels (here 8 and 2 in pattern) are added in the
right order *)
Notation"' 'C_' G ( A )" := (A,G) (at level 8, G at level 2).
(* Check import of notations from within a section *)
Notation"+1 x" := (S x) (at level 25, x at level 9). Section A. RequireImport make_notation. End A.
(* Check correct failure handling when a non-constructor notation is
used in cases pattern (bug #2724 in 8.3 and 8.4beta) *)
Notation"'FORALL' x .. y , P" := (forall x, .. (forall y, P) ..)
(at level 200, x binder, y binder, right associativity) : type_scope.
Fail Checkfun x => match x with S (FORALL x, _) => 0 end.
(* Bug #2708: don't check for scope of variables used as binder *)
Parameter traverse : (nat -> unit) -> (nat -> unit). Notation traverse_var f l := (traverse (fun l => f l) l).
(* Check that when an ident become a keyword, it does not break
previous rules relying on the string to be classified as an ident *)
Notation"'intros' x" := (S x) (at level 0). Goal True -> True. intros H. exact H. Qed.
(* Check absence of collision on ".." in nested notations with ".." *) Notation"[ a , .. , b ]" := (a, (.. (b,tt) ..)).
(* Check that vector notations do not break Ltac [] (bugs #4785, #4733) *) Notation"[ ]" := (nil _) (format "[ ]") : vector_scope. Goal True. idtac; []. (* important for test: no space here *) constructor. Qed.
(* Check parsing of { and } is not affected by notations #3479 *) Notation" |- {{ a }} b" := (a=b) (no associativity, at level 10). Goal True.
{{ exact I. }} Qed.
Check |- {{ 0 }} 0.
(* Check parsing of { and } is not affected by notations #3479 *) Notation" |- {{ a }} b" := (a=b) (no associativity, at level 10). Goal True.
{{ exact I. }} Qed.
(* Check that we can have notations without any symbol iff they are "only printing". *)
Fail Notation"" := (@nil). Notation"" := (@nil) (only printing).
(* Check that a notation cannot be neither parsing nor printing. *)
Fail Notation"'foobarkeyword'" := (@nil) (only parsing, only printing).
(* Check "where" clause for inductive types with parameters *)
Reserved Notation"x === y" (at level 50). Inductive EQ {A} (x:A) : A -> Prop := REFL : x === x where"x === y" := (EQ x y).
(* Check that strictly ident or _ are coerced to a name *)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.