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 functor MoreLabels.Map.Make. πŸ’–
  • module type S = sig end β€” Output signature of the functor MoreLabels.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