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