comparison tests/disjoint.ur @ 244:71bafe66dbe1

Laconic -> Ur
author Adam Chlipala <adamc@hcoop.net>
date Sun, 31 Aug 2008 08:32:18 -0400
parents tests/disjoint.lac@275aaeb73f1f
children
comparison
equal deleted inserted replaced
243:2b9dfaffb008 244:71bafe66dbe1
1 con c1 = fn x :: Name => [x] ~ [A] => [x = int, A = string]
2 con c2 = fn x :: Name => [x] ~ [A] => [A, x]
3 con c3 = fn x :: Name => [A] ~ [x] => [x, A]
4 con c4 = fn x :: Name => [A] ~ [x] => [A, x]
5
6 con c5 = fn r1 :: {Type} => fn r2 => r1 ~ r2 => r1 ++ r2
7 con c6 = fn r1 :: {Type} => fn r2 => r2 ~ r1 => r1 ++ r2
8
9 con c7 = fn x :: Name => fn r => [x] ~ r => [x = int] ++ r
10
11 val vt1 = fn x : $(c1 #B) => x.B
12 val vt2 = fn x : $(c1 #B) => x.A
13 val vt3 = fn x : $(c1 #C) => x.A
14 val vt4 = fn x : $(c1 #C) => x.A
15 (*
16 val vtX = fn x : $(c1 #A) => x.A
17 val vtX = fn x : $(c1 #A) => x.A
18 *)
19
20 val v1 = fn x :: Name => fn [x] ~ [A] => fn y : {x : int, A : string} => y.x
21
22 val vt5 = v1 [#B] {A = "Hi", B = 0}
23 (*
24 val vtX = v1 [#A] {A = "Hi", A = 0}
25 *)
26
27 val v2 = fn x :: Name => fn r :: {Type} => fn y : $(c7 x r) => fn [x] ~ r => y.x
28 val vt6 = v2 [#A] [[B = float, C = string]] {A = 8, B = 8.0, C = "8"}
29
30 (*
31 val vtX = v2 [#A] [[B = float, B = string]] {A = 8, B = 8.0, B = "8"}
32 val vtX = v2 [#A] [[A = float, B = string]] {A = 8, A = 8.0, B = "8"}
33 *)
34
35 val main = vt6