let only_once f = let instances = ref StringSet.empty in fun param -> if StringSet.mem param !instances then () else begin instances := StringSet.add param !instances; f param end