summaryrefslogtreecommitdiff
path: root/tests/reduce.ur
diff options
context:
space:
mode:
authorGravatar Adam Chlipala <adamc@hcoop.net>2008-08-31 08:32:18 -0400
committerGravatar Adam Chlipala <adamc@hcoop.net>2008-08-31 08:32:18 -0400
commit447b60afccc89ef18d8f92a260dd1fcdf735898e (patch)
tree93d1ffca9832084286525896afc4c17eaf5d23f4 /tests/reduce.ur
parent508290e29047e068b9db4b02485fefd9e3ced81c (diff)
Laconic -> Ur
Diffstat (limited to 'tests/reduce.ur')
-rw-r--r--tests/reduce.ur27
1 files changed, 27 insertions, 0 deletions
diff --git a/tests/reduce.ur b/tests/reduce.ur
new file mode 100644
index 00000000..f292a294
--- /dev/null
+++ b/tests/reduce.ur
@@ -0,0 +1,27 @@
+con c1 = int
+con c2 = (fn t :: Type => t) int
+
+con id = fn t :: Type => t
+con c3 = id int
+
+con fst = fn t1 :: Type => fn t2 :: Type => t1
+con c4 = fst int string
+
+con snd = fn t1 :: Type => fn t2 :: Type => t2
+con c5 = snd int string
+
+con apply = fn f :: Type -> Type => fn t :: Type => f t
+con c6 = apply id int
+con c7 = apply (fst int) string
+
+val tickle = fn n :: Name => fn t :: Type => fn fs :: {Type} =>
+ fn x : $([n = t] ++ fs) => x
+val tickleA = tickle[#A][int][[B = string]]
+val test_tickleA = tickleA {A = 6, B = "13"}
+
+val grab = fn n :: Name => fn t ::: Type => fn fs ::: {Type} =>
+ fn x : $([n = t] ++ fs) => x.n
+val test_grab1 = grab[#A] {A = 6, B = "13"}
+val test_grab2 = grab[#B] {A = 6, B = "13"}
+
+val main = {A = test_grab1, B = test_grab2}