let tab = " " let prefix_lines prefix = Str.global_replace (Str.regexp "^\\(.\\)") (prefix ^ "\\1") let indent = prefix_lines tab let rec cat sep fn = function | [] -> "" | [hd] -> fn hd | hd :: tl -> fn hd ^ sep ^ cat sep fn tl