Identifiable.Map(3)
π NAME π
Identifiable.Map β bestie, there is literally no description. That's it. That's the whole name section. Iconic of it, honestly. π
This page lives in the OCaml library section, and the module type in question is β you guessed it β Identifiable.Map. And yes, the manual name is Identifiable.Map(3) in case you were wondering which page you wandered into, queen. π
β¨ Module type β¨
π Module type Map
module type Map
= sig end
That's the whole thing up there β a sig ... end with the goods inside, which we're about to unwrap like a lil gift. π
πΈ Documentation πΈ
Okay so inside Map you've got all of this, and ngl it's a lot, but we're getting through it together, fr fr:
module T : Map.OrderedTypeβ the key module, giving us the ordering. Slay.include Map.Sβ everything fromMap.Sis included. So all the standard map behaviour comes along for the ride. Standard map energy. π
Then the extra functions this module adds on top:
val of_list : (key * 'a) list -> 'a tβ build a map out of a list ofkey/'apairs. Turn that list into a map, periodt.val disjoint_union : ?eq:('a -> 'a -> bool) -> ?print:(Format.formatter -> 'a -> unit) -> 'a t -> 'a t -> 'a tβ takesm1andm2and gives you a map containing all bindings fromm1andm2. But listen: if some binding is present in both and the associated value is not equal, aFatal_erroris raised. π Not a vibe check you want to fail.val union_right : 'a t -> 'a t -> 'a tβunion_right m1 m2contains all bindings fromm1andm2. If some binding is present in both, the one fromm2is taken. Right side wins, main character energy. πval union_left : 'a t -> 'a t -> 'a tβ literallyunion_left m1 m2 = union_right m2 m1. That's the whole definition, bestie. Left side wins.val union_merge : ('a -> 'a -> 'a) -> 'a t -> 'a t -> 'a tβ merge two maps with a function deciding the combined value. π§val rename : key t -> key -> keyβ renames a key. π¦val map_keys : (key -> key) -> 'a t -> 'a tβ map a function over all the keys. πval keys : 'a t -> Stdlib.Set.Make(T).tβ hands you back the keys as aStdlib.Set.Make(T).t. Yes, that set type exactly. No cap.val data : 'a t -> 'a listβ the values, as a list. πval of_set : (key -> 'a) -> Stdlib.Set.Make(T).t -> 'a tβ build a map from aStdlib.Set.Make(T).t, using akey -> 'afunction to make the values. πval transpose_keys_and_data : key t -> key tβ transposes keys and data. Bothkey, botht, chaotic but cute. πval transpose_keys_and_data_set : key t -> Stdlib.Set.Make(T).t tβ transposes keys and data, but the result is aStdlib.Set.Make(T).t t. π«Άval print : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unitβ prints a map. You give it a printer for'a, aFormat.formatter, and the map, and it does the printing thing. β¨
π Real talk though:disjoint_unionwill raise aFatal_erroron you if both maps have the same binding with non-equal values. So like, know that going in.
π That's the whole page, bestie β every val, every signature, every vibe. π¦
Signed off from the OCamldoc corner of the universe, dated 2026-06-22, page Identifiable.Map(3). πβ¨ Go forth and union responsibly. π
π¦ where this page comes from
- arch rolling: ocaml 5.5.0-1 Β· LGPL2.1 AND custom: QPL-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms