Mercurial > urweb
comparison tests/constraint.lac @ 88:7bab29834cd6
Constraints in modules
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Tue, 01 Jul 2008 15:58:02 -0400 |
parents | |
children | d3ee072fa609 |
comparison
equal
deleted
inserted
replaced
87:275aaeb73f1f | 88:7bab29834cd6 |
---|---|
1 signature S = sig | |
2 con nm :: Name | |
3 con r :: {Type} | |
4 | |
5 constraint [nm] ~ r | |
6 end | |
7 | |
8 structure M : S = struct | |
9 con nm = #A | |
10 con r = [B = float, C = string] | |
11 | |
12 constraint [A] ~ [B] | |
13 constraint [nm] ~ r | |
14 constraint [C] ~ [D] | |
15 end | |
16 | |
17 structure M' = struct | |
18 open M | |
19 | |
20 con combo = [nm = int] ++ r | |
21 end | |
22 | |
23 structure M' = struct | |
24 open constraints M | |
25 | |
26 con nm' = M.nm | |
27 con r' = M.r | |
28 con combo = [nm' = int] ++ r' | |
29 end |