summaryrefslogtreecommitdiff
path: root/src/Identifiers.ml
diff options
context:
space:
mode:
authorSon Ho2022-01-24 16:51:28 +0100
committerSon Ho2022-01-24 16:51:28 +0100
commite5dce61f35fcc0e716f7aadc32f254c8ba103887 (patch)
tree380df674714ed7133bf660bd9b75c233ced79485 /src/Identifiers.ml
parent3f10869014d639199fc18df661c3faf3b90e6462 (diff)
Start working on name generation for the synthesis
Diffstat (limited to 'src/Identifiers.ml')
-rw-r--r--src/Identifiers.ml17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/Identifiers.ml b/src/Identifiers.ml
index f2b88fd4..4880a19a 100644
--- a/src/Identifiers.ml
+++ b/src/Identifiers.ml
@@ -147,6 +147,21 @@ module IdGen () : Id = struct
module Map = C.MakeMap (Ord)
end
-type name = string list [@@deriving show]
+type name = string list [@@deriving show, ord]
(** A name such as: `std::collections::vector` (which would be represented as
[["std"; "collections"; "vector"]]) *)
+
+module NameOrderedType : C.OrderedType = struct
+ type t = name
+
+ let compare = compare_name
+
+ let to_string = String.concat "::"
+
+ let pp_t = pp_name
+
+ let show_t = show_name
+end
+
+module NameMap = C.MakeMap (NameOrderedType)
+module NameSet = C.MakeSet (NameOrderedType)