summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorkrasimir <krasimir@chalmers.se>2010-02-22 14:40:28 +0000
committerkrasimir <krasimir@chalmers.se>2010-02-22 14:40:28 +0000
commit21ad608e2a7a587805a6b99e8c07c6255de348c5 (patch)
tree868afe21bc25bf7a1506c901d30812af06d1a1a4 /examples
parentbcf4bc7d23f442155887860a2cfc2ce94b35cf6e (diff)
functors
Diffstat (limited to 'examples')
-rw-r--r--examples/category-theory/CategoryTheory.gf1
-rw-r--r--examples/category-theory/Functor.gf12
2 files changed, 13 insertions, 0 deletions
diff --git a/examples/category-theory/CategoryTheory.gf b/examples/category-theory/CategoryTheory.gf
index d896ceb35..d75f71694 100644
--- a/examples/category-theory/CategoryTheory.gf
+++ b/examples/category-theory/CategoryTheory.gf
@@ -2,6 +2,7 @@ abstract CategoryTheory
= Categories
, Morphisms
, InitialAndTerminal
+ , Functor
** {
} \ No newline at end of file
diff --git a/examples/category-theory/Functor.gf b/examples/category-theory/Functor.gf
new file mode 100644
index 000000000..70ec1a940
--- /dev/null
+++ b/examples/category-theory/Functor.gf
@@ -0,0 +1,12 @@
+abstract Functor = Categories ** {
+
+cat Functor (c1, c2 : Category) ;
+
+data functor : ({c1, c2} : Category)
+ -> (f0 : El c1 -> El c2)
+ -> (f1 : ({x,y} : El c1) -> Arrow x y -> Arrow (f0 x) (f0 y))
+ -> ((x : El c1) -> EqAr (f1 (id x)) (id (f0 x)))
+ -> (({x,y,z} : El c1) -> (f : Arrow x z) -> (g : Arrow z y) -> EqAr (f1 (comp g f)) (comp (f1 g) (f1 f)))
+ -> Functor c1 c2 ;
+
+} \ No newline at end of file