structure Format = struct fun listToString (show : 'a -> string) (l : 'a list) = "[" ^ String.concatWith ", " (map show l) ^ "]" fun pairToString showA showB (a, b) = "(" ^ showA a ^ ", " ^ showB b ^ ")" end