diff options
author | Son Ho | 2021-11-23 14:02:14 +0100 |
---|---|---|
committer | Son Ho | 2021-11-23 14:02:14 +0100 |
commit | b96bd19fe1ff22c2f1e03332468d4e6abb8a947e (patch) | |
tree | 00c889edf8bc828ef3c984c2fb2945239a5594b9 /src/Identifiers.ml | |
parent | fcc3a467886e5c95b065b1fc4c27301fd62d7c21 (diff) |
Implement formatting for eval_ctx
Diffstat (limited to 'src/Identifiers.ml')
-rw-r--r-- | src/Identifiers.ml | 8 |
1 files changed, 8 insertions, 0 deletions
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) ^ "}" |