diff options
author | Son Ho | 2022-01-24 16:51:28 +0100 |
---|---|---|
committer | Son Ho | 2022-01-24 16:51:28 +0100 |
commit | e5dce61f35fcc0e716f7aadc32f254c8ba103887 (patch) | |
tree | 380df674714ed7133bf660bd9b75c233ced79485 /src/Identifiers.ml | |
parent | 3f10869014d639199fc18df661c3faf3b90e6462 (diff) |
Start working on name generation for the synthesis
Diffstat (limited to '')
-rw-r--r-- | src/Identifiers.ml | 17 |
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) |