@@ -421,6 +421,22 @@ module Identifier = struct
421421 let compare = compare
422422 end
423423
424+ module DataType = struct
425+ type t = Id .path_datatype
426+ type t_pv = Id .path_datatype_pv
427+ let equal = equal
428+ let hash = hash
429+ let compare = compare
430+ end
431+
432+ module Constructor = struct
433+ type t = Id .path_constructor
434+ type t_pv = Id .constructor_pv
435+ let equal = equal
436+ let hash = hash
437+ let compare = compare
438+ end
439+
424440 module Value = struct
425441 type t = Id .path_value
426442 type t_pv = Id .value_pv
@@ -666,6 +682,7 @@ module Path = struct
666682 | `Type (p , _ ) -> inner (p : module_ :> any )
667683 | `Value (_ , t ) when Names.ValueName. is_internal t -> true
668684 | `Value (p , _ ) -> inner (p : module_ :> any )
685+ | `Constructor (p , _ ) -> inner (p : datatype :> any )
669686 | `Class (p , _ ) -> inner (p : module_ :> any )
670687 | `ClassType (p , _ ) -> inner (p : module_ :> any )
671688 | `Alias (dest , `Resolved src ) ->
@@ -680,6 +697,8 @@ module Path = struct
680697 | `CanonicalModuleType (x , _ ) -> inner (x : module_type :> any )
681698 | `CanonicalType (_ , `Resolved _ ) -> false
682699 | `CanonicalType (x , _ ) -> inner (x : type_ :> any )
700+ | `CanonicalDataType (_ , `Resolved _ ) -> false
701+ | `CanonicalDataType (x , _ ) -> inner (x : datatype :> any )
683702 | `OpaqueModule m -> inner (m :> any )
684703 | `OpaqueModuleType mt -> inner (mt :> any )
685704 in
@@ -742,6 +761,14 @@ module Path = struct
742761 | `Alias (dest , _src ) -> parent_module_identifier dest
743762 | `OpaqueModule m -> parent_module_identifier m
744763
764+ and parent_datatype_identifier :
765+ Paths_types.Resolved_path. datatype -> Identifier.DataType. t = function
766+ | `Identifier id ->
767+ (id : Identifier.Path.DataType.t :> Identifier.DataType.t )
768+ | `CanonicalDataType (_ , `Resolved p ) -> parent_datatype_identifier p
769+ | `CanonicalDataType (p , _ ) -> parent_datatype_identifier p
770+ | `Type (m , n ) -> Identifier.Mk. type_ (parent_module_identifier m, n)
771+
745772 module Module = struct
746773 type t = Paths_types.Resolved_path .module_
747774
@@ -757,6 +784,14 @@ module Path = struct
757784 type t = Paths_types.Resolved_path .type_
758785 end
759786
787+ module DataType = struct
788+ type t = Paths_types.Resolved_path .datatype
789+ end
790+
791+ module Constructor = struct
792+ type t = Paths_types.Resolved_path .constructor
793+ end
794+
760795 module Value = struct
761796 type t = Paths_types.Resolved_path .value
762797 end
@@ -775,6 +810,8 @@ module Path = struct
775810 | `Apply (m , _ ) -> identifier (m :> t )
776811 | `Type (m , n ) -> Identifier.Mk. type_ (parent_module_identifier m, n)
777812 | `Value (m , n ) -> Identifier.Mk. value (parent_module_identifier m, n)
813+ | `Constructor (m , n ) ->
814+ Identifier.Mk. constructor (parent_datatype_identifier m, n)
778815 | `ModuleType (m , n ) ->
779816 Identifier.Mk. module_type (parent_module_identifier m, n)
780817 | `Class (m , n ) -> Identifier.Mk. class_ (parent_module_identifier m, n)
@@ -794,6 +831,8 @@ module Path = struct
794831 | `CanonicalModuleType (p , _ ) -> identifier (p :> t )
795832 | `CanonicalType (_ , `Resolved p ) -> identifier (p :> t )
796833 | `CanonicalType (p , _ ) -> identifier (p :> t )
834+ | `CanonicalDataType (_ , `Resolved p ) -> identifier (p :> t )
835+ | `CanonicalDataType (p , _ ) -> identifier (p :> t )
797836 | `OpaqueModule m -> identifier (m :> t )
798837 | `OpaqueModuleType mt -> identifier (mt :> t )
799838
@@ -812,6 +851,14 @@ module Path = struct
812851 type t = Paths_types.Path .type_
813852 end
814853
854+ module DataType = struct
855+ type t = Paths_types.Path .datatype
856+ end
857+
858+ module Constructor = struct
859+ type t = Paths_types.Path .constructor
860+ end
861+
815862 module Value = struct
816863 type t = Paths_types.Path .value
817864 end
0 commit comments