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@150: {fold [fn rs :: {Unit} => $(stringify rs) -> xml body [] []] adamc@150: (fn nm :: Name => fn u :: Unit => fn rest :: {Unit} => adamc@150: fn f : $(stringify rest) -> xml body [] [] => adamc@150: fn x : $(stringify ([nm] ++ rest)) => adamc@150: