summaryrefslogtreecommitdiff
path: root/transfer/examples/pair.tr
diff options
context:
space:
mode:
authorbringert <bringert@cs.chalmers.se>2005-11-25 16:36:19 +0000
committerbringert <bringert@cs.chalmers.se>2005-11-25 16:36:19 +0000
commitdbe8e61acc616b8f5ac07e8df89eb98a7997c29d (patch)
tree6e379f18986fc60f5606e023def46abdf770dca5 /transfer/examples/pair.tr
parentfe2731e5f8e301b5a0169bf8b667bb6c13bae80b (diff)
Move transfer into the GF repo.
Diffstat (limited to 'transfer/examples/pair.tr')
-rw-r--r--transfer/examples/pair.tr11
1 files changed, 11 insertions, 0 deletions
diff --git a/transfer/examples/pair.tr b/transfer/examples/pair.tr
new file mode 100644
index 000000000..07182e301
--- /dev/null
+++ b/transfer/examples/pair.tr
@@ -0,0 +1,11 @@
+Pair : Type -> Type -> Type ;
+Pair A B = { p1 : A; p2 : B } ;
+
+pair : (A:Type) -> (B:Type) -> A -> B -> Pair A B ;
+pair _ _ x y = { p1 = x; p2 = y } ;
+
+fst : (A:Type) -> (B:Type) -> Pair A B -> A ;
+fst _ _ p = case p of { (Pair _ _ x _) -> x } ;
+
+snd : (A:Type) -> (B:Type) -> Pair A B -> B ;
+snd _ _ p = case p of { (Pair _ _ x _) -> x } ;