diff options
author | 2008-07-01 15:58:02 -0400 | |
---|---|---|
committer | 2008-07-01 15:58:02 -0400 | |
commit | cdc1211c43e9073a4d03472ffb549c67df281cea (patch) | |
tree | 119cb9eae8a53423d4383f3e627d8de4999c6e78 /tests/constraint.lac | |
parent | 73b8b2cf8afd5cc8969b3bd4d2c238d9c453e8fd (diff) |
Constraints in modules
Diffstat (limited to 'tests/constraint.lac')
-rw-r--r-- | tests/constraint.lac | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/constraint.lac b/tests/constraint.lac new file mode 100644 index 00000000..54c77093 --- /dev/null +++ b/tests/constraint.lac @@ -0,0 +1,29 @@ +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 |