this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

odoc: change Poly variant to carry optional jkinds per variable

Poly of string list * t --> Poly of (string * string option) list * t

Each universally quantified variable can now carry an optional jkind
annotation (e.g. value_or_null, float64). This enables showing the
jkind at the binding site rather than repeating it at every use.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

+15 -8
+2 -1
src/document/generator.ml
··· 519 519 format_type_path ~delim:`brackets args 520 520 (Link.from_path (path :> Paths.Path.t)) 521 521 | Poly (polyvars, t) -> 522 - O.txt ("'" ^ String.concat ~sep:" '" polyvars ^ ". ") ++ type_expr t 522 + let polyvar_names = List.map fst polyvars in 523 + O.txt ("'" ^ String.concat ~sep:" '" polyvar_names ^ ". ") ++ type_expr t 523 524 | Quote t -> 524 525 O.span (O.txt "<[ " ++ O.box_hv (type_expr t) ++ O.txt " ]>") 525 526 | Splice t ->
+1 -1
src/loader/cmi.cppo.ml
··· 670 670 | Tpoly (typ, []) -> read_type_expr env typ 671 671 | Tpoly (typ, tyl) -> 672 672 let tyl = List.map Compat.repr tyl in 673 - let vars = List.map name_of_type_repr tyl in 673 + let vars = List.map (fun t -> (name_of_type_repr t, None)) tyl in 674 674 let typ = read_type_expr env typ in 675 675 remove_names tyl; 676 676 Poly(vars, typ)
+2 -2
src/loader/cmti.cppo.ml
··· 182 182 #if defined OXCAML 183 183 | Ttyp_poly(vars, typ) -> 184 184 (* TODO: presumably want the layouts, eventually *) 185 - Poly(List.map fst vars, read_core_type env container typ) 185 + Poly(List.map (fun (s, _) -> (s, None)) vars, read_core_type env container typ) 186 186 #else 187 - | Ttyp_poly(vars, typ) -> Poly(vars, read_core_type env container typ) 187 + | Ttyp_poly(vars, typ) -> Poly(List.map (fun s -> (s, None)) vars, read_core_type env container typ) 188 188 #endif 189 189 #if OCAML_VERSION >= (5,4,0) 190 190 | Ttyp_package {tpt_path = pack_path; tpt_cstrs=pack_fields; _} ->
+5 -1
src/model/lang.ml
··· 484 484 | Polymorphic_variant of TypeExpr.Polymorphic_variant.t 485 485 | Object of TypeExpr.Object.t 486 486 | Class of Path.ClassType.t * t list 487 - | Poly of string list * t 487 + | Poly of (string * string option) list * t 488 + (** Universally quantified type variables with optional jkind 489 + annotation, e.g. [("a", Some "value_or_null")] for 490 + [('a : value_or_null). ...]. The jkind is [None] for the 491 + default [value] layout. *) 488 492 | Quote of t 489 493 | Splice of t 490 494 | Package of TypeExpr.Package.t
+3 -1
src/model_desc/lang_desc.ml
··· 666 666 | Object x -> C ("Object", x, typeexpr_object) 667 667 | Class (x1, x2) -> 668 668 C ("Class", ((x1 :> Paths.Path.t), x2), Pair (path, List typeexpr_t)) 669 - | Poly (x1, x2) -> C ("Poly", (x1, x2), Pair (List string, typeexpr_t)) 669 + | Poly (x1, x2) -> 670 + C ("Poly", (x1, x2), 671 + Pair (List (Pair (string, Option string)), typeexpr_t)) 670 672 | Quote x -> C ("Quote", x, typeexpr_t) 671 673 | Splice x -> C ("Splice", x, typeexpr_t) 672 674 | Package x -> C ("Package", x, typeexpr_package))
+1 -1
src/xref2/component.ml
··· 129 129 | Polymorphic_variant of TypeExpr.Polymorphic_variant.t 130 130 | Object of TypeExpr.Object.t 131 131 | Class of Cpath.class_type * t list 132 - | Poly of string list * t 132 + | Poly of (string * string option) list * t 133 133 | Quote of t 134 134 | Splice of t 135 135 | Package of TypeExpr.Package.t
+1 -1
src/xref2/component.mli
··· 124 124 | Polymorphic_variant of TypeExpr.Polymorphic_variant.t 125 125 | Object of TypeExpr.Object.t 126 126 | Class of Cpath.class_type * t list 127 - | Poly of string list * t 127 + | Poly of (string * string option) list * t 128 128 | Quote of t 129 129 | Splice of t 130 130 | Package of TypeExpr.Package.t