adamc@151: con stringify = fold (fn nm :: Name => fn u :: Unit => fn t :: {Type} => [nm = string] ++ t) [] adamc@151: adamc@151: signature S = sig adamc@151: con rs :: {Unit} adamc@151: val names : $(stringify rs) adamc@151: end adamc@151: adamc@151: signature S' = sig adamc@151: con rs :: {Unit} adamc@151: adamc@151: val handler : $(stringify rs) -> page adamc@151: val page : unit -> page adamc@151: end adamc@151: adamc@151: functor F (M : S) : S' where con rs = M.rs = struct adamc@151: con rs = M.rs adamc@151: adamc@151: val handler = fn x : $(stringify M.rs) =>
adamc@151: {fold [fn rs :: {Unit} => $(stringify rs) -> $(stringify rs) -> xml body [] []] adamc@151: (fn nm :: Name => fn u :: Unit => fn rest :: {Unit} => adamc@151: fn f : $(stringify rest) -> $(stringify rest) -> xml body [] [] => adamc@151: fn names : $(stringify ([nm] ++ rest)) => adamc@151: fn x : $(stringify ([nm] ++ rest)) => adamc@151: