Skip to content

Commit 17d6561

Browse files
committed
more
1 parent f6c1970 commit 17d6561

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed

tests/monoid_enriched_cat.v

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
From HB Require Import structures.
2+
From Coq Require Import ssreflect ssrfun.
3+
4+
HB.mixin Record isQuiver Obj := { hom : Obj -> Obj -> Type }.
5+
6+
HB.structure Definition Quiver := { Obj of isQuiver Obj }.
7+
8+
HB.mixin Record isMon A := {
9+
zero : A;
10+
add : A -> A -> A;
11+
addrA : associative add;
12+
add0r : left_id zero add;
13+
addr0 : right_id zero add;
14+
}.
15+
16+
HB.structure
17+
Definition Monoid := { A of isMon A }.
18+
19+
Fail HB.structure
20+
Definition Monoid_enriched_quiver :=
21+
{ Obj of isQuiver Obj &
22+
(forall A B : Obj, isMon (@hom (Quiver.clone Obj _) A B)) }.
23+
24+
25+
HB.mixin Record hom_isMon T of Quiver T :=
26+
{ private : forall A B, isMon (@hom T A B) }.
27+
28+
HB.structure
29+
Definition Monoid_enriched_quiver :=
30+
{ Obj of isQuiver Obj & hom_isMon Obj }.
31+
32+
HB.instance Definition _ (T : Monoid_enriched_quiver.type) (A B : T) : isMon (@hom T A B) :=
33+
@private T A B.
34+
35+
(* each instance of isMon should be tried as an instance of hom_isMon *)
36+
37+

0 commit comments

Comments
 (0)