| 1 |
(* -*- coq-prog-args: ("-nois") -*- *) |
| 2 |
Delimit Scope type_scope with type. |
| 3 |
Delimit Scope function_scope with function. |
| 4 |
|
| 5 |
Bind Scope type_scope with Sortclass. |
| 6 |
Bind Scope function_scope with Funclass. |
| 7 |
|
| 8 |
Reserved Notation "x -> y" (at level 99, right associativity, y at level 200). |
| 9 |
Notation "A -> B" := (forall (_ : A), B) : type_scope. |
| 10 |
|
| 11 |
Definition compose {A B C} (g : B -> C) (f : A -> B) := |
| 12 |
fun x : A => g (f x). |
| 13 |
|
| 14 |
Notation " g ∘ f " := (compose g f) |
| 15 |
(at level 40, left associativity) : function_scope. |
| 16 |
|
| 17 |
Fail Check (fun x => x) ∘ (fun x => x). (* this [Check] should fail, as [function_scope] is not opened *) |
| 18 |
Check compose ((fun x => x) ∘ (fun x => x)) (fun x => x). (* this check should succeed, as [function_scope] should be automatically bound in the arguments to [compose] *) |