Set.OrderedType(3)
okay so bestie, welcome to the Set.OrderedType(3) page from the OCaml library — it’s giving “input signature of the functor Set.Make” energy, and we’re gonna read it together like the main characters we are 💅✨
💖 NAME 💖
Set.OrderedType — input signature of the functor Set.Make. that’s the whole name situation, no cap 🎀
🧚 Module type 🧚
Module type Set.OrderedType:
Module type Set.OrderedType
✨ Documentation ✨
here’s the actual module type, bestie:
Module type OrderedType
= sig end
it’s the input signature of the functor Set.Make — yes, that Set.Make, the icon 👑
🌸 the type 🌸
type t
t is the type of the set elements. literally the element type, that’s it, that’s the vibe 🦋
🔥 compare 🔥
val compare : t -> t -> int
compare is a total ordering function over the set elements. it’s a two-argument function f such that:
f e1 e2is zero if the elementse1ande2are equalf e1 e2is strictly negative ife1is smaller thane2f e1 e2is strictly positive ife1is greater thane2
Example: a suitable ordering function is the generic structural comparison function compare. yes, the function is also named compare, stay with me 😭💖
lowkey important: total ordering function, okay? equal goes to zero, smaller goes negative, bigger goes positive. that’s the whole contract, periodt 🫶
mwah 💋 this iconic page came from source/version OCamldoc, dated 2026-06-22, and the footer title is Set.OrderedType(3). go be the main character of your own sets 🌈👑
📦 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