comparison tests/reduce.ur @ 244:71bafe66dbe1

Laconic -> Ur
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 Aug 2008 08:32:18 -0400
parents tests/reduce.lac@bfa2e9ae4df8
children
comparison
equal deleted inserted replaced
243:2b9dfaffb008 244:71bafe66dbe1
1 con c1 = int
2 con c2 = (fn t :: Type => t) int
3
4 con id = fn t :: Type => t
5 con c3 = id int
6
7 con fst = fn t1 :: Type => fn t2 :: Type => t1
8 con c4 = fst int string
9
10 con snd = fn t1 :: Type => fn t2 :: Type => t2
11 con c5 = snd int string
12
13 con apply = fn f :: Type -> Type => fn t :: Type => f t
14 con c6 = apply id int
15 con c7 = apply (fst int) string
16
17 val tickle = fn n :: Name => fn t :: Type => fn fs :: {Type} =>
18 fn x : $([n = t] ++ fs) => x
19 val tickleA = tickle[#A][int][[B = string]]
20 val test_tickleA = tickleA {A = 6, B = "13"}
21
22 val grab = fn n :: Name => fn t ::: Type => fn fs ::: {Type} =>
23 fn x : $([n = t] ++ fs) => x.n
24 val test_grab1 = grab[#A] {A = 6, B = "13"}
25 val test_grab2 = grab[#B] {A = 6, B = "13"}
26
27 val main = {A = test_grab1, B = test_grab2}