From b96bd19fe1ff22c2f1e03332468d4e6abb8a947e Mon Sep 17 00:00:00 2001 From: Son Ho Date: Tue, 23 Nov 2021 14:02:14 +0100 Subject: Implement formatting for eval_ctx --- src/Identifiers.ml | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/Identifiers.ml') diff --git a/src/Identifiers.ml b/src/Identifiers.ml index cab1bafa..f01d4f47 100644 --- a/src/Identifiers.ml +++ b/src/Identifiers.ml @@ -40,6 +40,8 @@ module type Id = sig val set_to_string : Set.t -> string + module Map : Map.S with type key = id + val id_of_json : Yojson.Basic.t -> (id, string) result val vector_of_json : @@ -98,6 +100,12 @@ module IdGen () : Id = struct let compare = compare end) + module Map = Map.Make (struct + type t = id + + let compare = compare + end) + let set_to_string ids = let ids = Set.fold (fun id ids -> to_string id :: ids) ids [] in "{" ^ String.concat ", " (List.rev ids) ^ "}" -- cgit v1.2.3