diff options
author | Adam Chlipala <adamc@hcoop.net> | 2008-08-31 08:32:18 -0400 |
---|---|---|
committer | Adam Chlipala <adamc@hcoop.net> | 2008-08-31 08:32:18 -0400 |
commit | 447b60afccc89ef18d8f92a260dd1fcdf735898e (patch) | |
tree | 93d1ffca9832084286525896afc4c17eaf5d23f4 /tests/constraint.ur | |
parent | 508290e29047e068b9db4b02485fefd9e3ced81c (diff) |
Laconic -> Ur
Diffstat (limited to 'tests/constraint.ur')
-rw-r--r-- | tests/constraint.ur | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/tests/constraint.ur b/tests/constraint.ur new file mode 100644 index 00000000..e350a4ea --- /dev/null +++ b/tests/constraint.ur @@ -0,0 +1,45 @@ +signature S = sig + con nm :: Name + con r :: {Type} + + constraint [nm] ~ r +end + +structure M : S = struct + con nm = #A + con r = [B = float, C = string] + + constraint [A] ~ [B] + constraint [nm] ~ r + constraint [C] ~ [D] +end + +structure M' = struct + open M + + con combo = [nm = int] ++ r +end + +structure M' = struct + open constraints M + + con nm' = M.nm + con r' = M.r + con combo = [nm' = int] ++ r' +end + + +signature S' = sig + con r1 :: {Type} + con r2 :: {Type} + + constraint r1 ~ r2 +end + +functor F (M : S) : S' = struct + con r1 = [M.nm = int] + con r2 = M.r + + open constraints M + constraint r1 ~ r2 +end |