Identifiable.S.Map(3)
π Identifiable.S.Map(3) β the OCaml library page where maps get β¨identifiableβ¨
okay so bestie, welcome to Identifiable.S.Map(3) from the OCaml library manual π this is the page for the Identifiable.S.Map module, and ngl it's a short one but it's lowkey iconic. let's get into it π¦
πΈ NAME πΈ
Identifiable.S.Map β no description π yeah that's it, that's the whole name section. she's mysterious. she's giving "no thoughts, head empty" but make it a manpage. π
π§ Module π§
Module Identifiable.S.Map
β¨ Documentation β¨
π₯ Module Map π₯
: sig end
okay so before we get to the fun stuff, we gotta meet the supporting cast:
module T : Map.OrderedTypeβ this is the ordered-type module that makes the whole map thing work, iykyk πinclude Map.Sβ and boom, everything fromMap.Sis included in here too. she's standing on the shoulders of giants fr fr π
π«Ά The functions π«Ά
π val of_list : (key * 'a) list -> 'a t
builds you a map out of a list of key * 'a pairs. cute, simple, slay. β¨
π val disjoint_union : ?eq:('a -> 'a -> bool) -> ?print:(Format.formatter -> 'a -> unit) -> 'a t -> 'a t -> 'a t
disjoint_union m1 m2 contains all bindings from m1 and m2. but listen π β if some binding is present in both and the associated value is not equal, a Fatal_error is raised π so likeβ¦ she does NOT want your values disagreeing. keep it consistent or she WILL throw hands (well, throw an error). π
π val union_right : 'a t -> 'a t -> 'a t
union_right m1 m2 contains all bindings from m1 and m2. and if some binding is present in both? the one from m2 is taken. m2 wins, periodt. π m2 is the main character here ngl.
π val union_left : 'a t -> 'a t -> 'a t
union_left m1 m2 = union_right m2 m1
literally just flipping the script so m1 gets to be the main character instead. queen behavior. π
π val union_merge : ('a -> 'a -> 'a) -> 'a t -> 'a t -> 'a t
you bring your own merge function and she merges with it. choose-your-own-adventure vibes fr fr πΈ
π val rename : key t -> key -> key
renames a key. tiny, powerful, obsessed. π
π val map_keys : (key -> key) -> 'a t -> 'a t
maps a function over all the keys. every single one. no key left behind bestie π«Ά
π val keys : 'a t -> Stdlib.Set.Make(T).t
hands you back all the keys as a Stdlib.Set.Make(T).t. a whole set of them. gorgeous π
π val data : 'a t -> 'a list
and here's all the data as an 'a list, no keys, just vibes. π¦
π val of_set : (key -> 'a) -> Stdlib.Set.Make(T).t -> 'a t
takes a set and a function from key to 'a and builds you a map. reverse-engineering the whole thing, iconic. β
π val transpose_keys_and_data : key t -> key t
flips keys and data around. wait, both are key here so likeβ¦ it's a key t in and a key t out. symmetry! we love to see it β¨
π val transpose_keys_and_data_set : key t -> Stdlib.Set.Make(T).t t
same transpose energy, but the data comes out as a Stdlib.Set.Make(T).t instead. set-pilled π
π val print : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit
you give her a printing function for your 'a values, a formatter, and a map, and she prints it out. curated, formatted, immaculate. π
ok bestie quick vibe check π every single option and signature above is exactly as written β don't come for me if you typo one of those type signatures, she is picky about that fr fr π
and that's the whole page!! short and sweet, just how we like it. no cap, you now understand Identifiable.S.Map better than like 90% of people. slay. π
β¨
this page came to you courtesy of OCamldoc, dated 2026-06-22 β mwah, thanks for reading bestie, ily π«Άπ
π¦ 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