summaryrefslogtreecommitdiff
path: root/src/Identifiers.ml
diff options
context:
space:
mode:
Diffstat (limited to '')
-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)