annotate tests/gform.lac @ 146:80ac94b54e41

Fix opening and corifying of functors
author Adam Chlipala <adamc@hcoop.net>
date Tue, 22 Jul 2008 18:20:13 -0400
parents
children eb16f2aadbe9
rev   line source
adamc@146 1 con stringify = fold (fn nm :: Name => fn u :: Unit => fn t :: {Type} => [nm = string] ++ t) []
adamc@146 2
adamc@146 3 signature S = sig
adamc@146 4 con rs :: {Unit}
adamc@146 5 end
adamc@146 6
adamc@146 7 signature S' = sig
adamc@146 8 con rs :: {Unit}
adamc@146 9
adamc@146 10 val handler : $(stringify rs) -> page
adamc@146 11 val page : unit -> page
adamc@146 12 end
adamc@146 13
adamc@146 14 functor F (M : S) : S' where con rs = M.rs = struct
adamc@146 15 con rs = M.rs
adamc@146 16
adamc@146 17 val handler = fn x : $(stringify M.rs) => <html><body>
adamc@146 18 OK.
adamc@146 19 </body></html>
adamc@146 20
adamc@146 21 val page = fn () => <html><body>
adamc@146 22
adamc@146 23 </body></html>
adamc@146 24 end
adamc@146 25
adamc@146 26 structure M = F(struct
adamc@146 27 con rs = []
adamc@146 28 end)
adamc@146 29
adamc@146 30 open M
adamc@146 31