Mercurial > urweb
comparison demo/ref.ur @ 419:cb5897276abf
Fix bug with bringing functor argument instances into scope; Ref demo, minus prose
author | Adam Chlipala <adamc@hcoop.net> |
---|---|
date | Thu, 23 Oct 2008 17:35:10 -0400 |
parents | |
children | c471345f5165 |
comparison
equal
deleted
inserted
replaced
418:ad7e854a518c | 419:cb5897276abf |
---|---|
1 structure IR = RefFun.Make(struct | |
2 type t = int | |
3 val inj = _ | |
4 end) | |
5 | |
6 structure SR = RefFun.Make(struct | |
7 type t = string | |
8 val inj = _ | |
9 end) | |
10 | |
11 fun main () = | |
12 ir <- IR.new 3; | |
13 ir' <- IR.new 7; | |
14 sr <- SR.new "hi"; | |
15 | |
16 () <- IR.write ir' 10; | |
17 | |
18 iv <- IR.read ir; | |
19 iv' <- IR.read ir'; | |
20 sv <- SR.read sr; | |
21 | |
22 () <- IR.delete ir; | |
23 () <- IR.delete ir'; | |
24 () <- SR.delete sr; | |
25 | |
26 return <xml><body> | |
27 {[iv]}, {[iv']}, {[sv]} | |
28 </body></xml> |