Pqueue.OrderedType(3)

okay so bestie, you're on the Pqueue.OrderedType(3) page from the OCaml library, and it's giving ✨input-signature energy✨ for the functors Pqueue.MakeMin and Pqueue.MakeMax. no cap, this is the blueprint those functors are looking for πŸ’…

πŸŽ€ NAME πŸŽ€

Pqueue.OrderedType β€” Input signature of the functors Pqueue.MakeMin and Pqueue.MakeMax.

🧚 Module type 🧚

Module type Pqueue.OrderedType β€” yes, that's literally the module type we're documenting here, bestie.

πŸ’– Documentation πŸ’–

okay so the module type is OrderedType, and it's a sig end situation with these goodies inside:

       Module type OrderedType
        = sig end

It's the Input signature of the functors Pqueue.MakeMin and Pqueue.MakeMax. those functors are the main characters, and this is the contract they require 🫢

  • type t β€” The type of elements. that's the element type, periodt.
  • val compare : t -> t -> int β€” A total ordering function to compare elements.

So compare is a two-argument function f such that:

  • f e1 e2 is zero if the elements e1 and e2 are equal,
  • f e1 e2 is strictly negative if e1 is smaller than e2, and
  • f e1 e2 is strictly positive if e1 is greater than e2.

The generic structural comparison function compare is a suitable ordering function for element types such as int or string. slay πŸ”₯


mwah πŸ’‹ this icon of a page was brought to you by OCamldoc, dated 2026-06-22, and it's the Pqueue.OrderedType(3) page. stay iconic πŸŒˆπŸ‘‘

πŸ“¦ where this page comes from