Stdlib.Unit(3)

okay so we're in the OCaml library manual, and this page is Stdlib.Unit(3) β€” come on, bestie, it's unit type time πŸ’…βœ¨

πŸ’– NAME πŸ’–

Stdlib.Unit β€” literally no description, no cap 🫢


πŸ¦‹ Module πŸ¦‹

The module line is giving:

Module   Stdlib.Unit

πŸŽ€ Documentation πŸŽ€

Under Documentation, we got Module Unit pointing at:

Module Unit
 : (module Stdlib__Unit)

🌸 The unit type 🌸

The type is exactly this, bestie:

type t = unit =
 | ()

It is The unit type. Iconic. Main character energy fr fr ✨

The constructor () is included here so that it has a path, but it is not intended to be used in user-defined data types. Like, it's there for path reasons, not for you to go build your own little data types with it πŸ™ˆ

  • val equal : t -> t -> bool β€” equal u1 u2 is true. That's it, that's the vibe βœ…
  • val compare : t -> t -> int β€” compare u1 u2 is 0. Zero. Nothing. Chill 🧊
  • val to_string : t -> string β€” to_string b is "()". It literally turns into those two parentheses, and honestly? slay πŸ’€

This little page was brought to you by OCamldoc, dated 2026-06-22, for Stdlib.Unit(3) πŸ’œπŸ«Ά

πŸ“¦ where this page comes from