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