MoreLabels.Map(3)
πΈ NAME πΈ
MoreLabels.Map β no description. And yes bestie, this whole page is MoreLabels.Map(3), the manual page for the MoreLabels.Map module. Not a single description in sight, and honestly? Iconic.
π MODULE π
Module MoreLabels.Map
π DOCUMENTATION π
π¦ Module Map : sig end π¦
Okay so this is all about association tables over ordered types. This module implements applicative association tables β also known as finite maps or dictionaries β given a total ordering function over the keys. All operations over maps are purely applicative (no side-effects) β zero drama, zero mutation. The implementation uses balanced binary trees, and therefore searching and insertion take time logarithmic in the size of the map. Slay.
For instance, check this out:
module IntPairs =
struct
type t = int * int
let compare (x0,y0) (x1,y1) =
match Stdlib.compare x0 x1 with
0 -> Stdlib.compare y0 y1
| c -> c
end
module PairsMap = Map.Make(IntPairs)
let m = PairsMap.(empty |> add (0,1) "hello" |> add (1,0) "world")
So this creates a new module PairsMap, with a new type 'a PairsMap.t of maps from int * int to 'a. In this example, m contains string values so its type is string PairsMap.t. Bestie, that type check is chefβs kiss ππ
module type OrderedType = sig endβ Input signature of the functorMoreLabels.Map.Make. πmodule type S = sig endβ Output signature of the functorMoreLabels.Map.Make. β¨module Make : (Ord : OrderedType) -> sig endβ Functor building an implementation of the map structure given a totally ordered type. π
xoxo, your OCaml bestie π β this page is from OCamldoc, dated 2026-06-22. periodt.
π¦ 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