Mercurial > urweb
annotate 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 |
rev | line source |
---|---|
adamc@419 | 1 structure IR = RefFun.Make(struct |
adamc@419 | 2 type t = int |
adamc@419 | 3 val inj = _ |
adamc@419 | 4 end) |
adamc@419 | 5 |
adamc@419 | 6 structure SR = RefFun.Make(struct |
adamc@419 | 7 type t = string |
adamc@419 | 8 val inj = _ |
adamc@419 | 9 end) |
adamc@419 | 10 |
adamc@419 | 11 fun main () = |
adamc@419 | 12 ir <- IR.new 3; |
adamc@419 | 13 ir' <- IR.new 7; |
adamc@419 | 14 sr <- SR.new "hi"; |
adamc@419 | 15 |
adamc@419 | 16 () <- IR.write ir' 10; |
adamc@419 | 17 |
adamc@419 | 18 iv <- IR.read ir; |
adamc@419 | 19 iv' <- IR.read ir'; |
adamc@419 | 20 sv <- SR.read sr; |
adamc@419 | 21 |
adamc@419 | 22 () <- IR.delete ir; |
adamc@419 | 23 () <- IR.delete ir'; |
adamc@419 | 24 () <- SR.delete sr; |
adamc@419 | 25 |
adamc@419 | 26 return <xml><body> |
adamc@419 | 27 {[iv]}, {[iv']}, {[sv]} |
adamc@419 | 28 </body></xml> |