Module Os.Name

OS names.

type id = string

The type for OS identifiers.

type t =
  1. | Bsd of id
  2. | Darwin of id
  3. | Linux of id
  4. | Windows of id
  5. | Other of id

The type for OS names.

Names are sorted into families. The datum of each family has the concrete OS identifier.

Warning. Minor versions of the library may add new family enumerants or attach a family to an identifier previously classified as Other (moving between families should not happen, except to fix the odd bug). As such:

  • Pattern matching on Other "…" constants is not recommended. If you need to select such an identifier start by pattern matching on id before dropping to pattern matching on this type.
  • Unless you want your code to be informed by the introduction of a new family, end your pattern match with a catch all branch _ rather than Other _.
val id : t -> id

id n is the identifier of n.

Predicates and comparisons

val equal : t -> t -> bool

equal asserts equality by family, except for Other id values which are each their own distinct family.

val compare : t -> t -> int

compare is a total order compatible with equal.

Formatting

val pp : t Fmt.t

pp formats families for inspection. The concrete identifier is not printed.

val pp_id : t Fmt.t

pp_id ppf n formats the id of n.