Misc.Style(3)

✨ NAME ✨

okay bestie, welcome to Misc.Style(3) from the OCaml library πŸ’–

Misc.Style β€” no description.

No cap, the original page literally says β€œno description,” and we are not gonna invent one. The silence is iconic. πŸ’€


πŸŽ€ Module πŸŽ€

Module Misc.Style

That's the module name, periodt. 🫢


πŸ’– Documentation πŸ’–

Module Style : sig end

Yes bestie, the signature is literally sig end β€” we respect the minimalist queen energy. πŸ‘‘

Here's the color type, full rainbow-cafeteria realness:

type color =
 | Black
 | Red
 | Green
 | Yellow
 | Blue
 | Magenta
 | Cyan
 | White

And the style type, with all its variants exactly as listed:

type style =
 | FG of color
 | BG of color
 | Bold
 | Reset

Then we've got this extension of Format.stag, and the constructor is Style of style list:

type Format.stag +=
 | Style of style list

The ansi_of_style_l signature is giving style list -> string:

val ansi_of_style_l : style list -> string

Now the tag_style record β€” three fields, all accounted for:

type tag_style = {
  ansi : style list ;
  text_open : string ;
  text_close : string ;
  }

And the styles record, with every field in its original order:

type styles = {
  error : tag_style ;
  warning : tag_style ;
  loc : tag_style ;
  hint : tag_style ;
  inline_code : tag_style ;
  }

The rest of the vals, bestie β€” signatures stay exactly as the page says:

  • val hint : Format_doc.formatter -> unit β€” formatter in, unit out, that's the shape.
  • val as_inline_code : 'a Format_doc.printer -> 'a Format_doc.printer β€” printer in, printer out, same 'a.
  • val inline_code : string Format_doc.printer β€” literally a string Format_doc.printer.
  • val default_styles : styles β€” a styles value, no extra lore.
  • val get_styles : unit -> styles β€” unit in, styles out.
  • val set_styles : styles -> unit β€” styles in, unit out.
  • val setup : Misc.Color.setting option -> unit β€” takes a Misc.Color.setting option, gives back unit.
  • val set_tag_handling : Format.formatter -> unit β€” takes a Format.formatter, gives back unit.

this lil' page came from OCamldoc, dated 2026-06-22, and it's the Misc.Style(3) page β€” bye bestie, go slay some formatting πŸ’…βœ¨πŸ«Ά

πŸ“¦ where this page comes from