package pp-binary-ints

  1. Overview
  2. Docs

The Flags module contains types to modify how binary integers are printed.

type padding =
  1. | Left
  2. | Right
  3. | Zeros
    (*

    padding controls whether spaces are are added on the left or right or if zero prefixes are added.

    *)
type zero_printing =
  1. | OCaml
  2. | InheritNonZero
    (*

    zero_printing controls whether zeros printed similar to how Printf prints zeros or if zeros are printed similar to non-zero integers.

    *)
type flags = {
  1. padding : padding;
  2. separators : bool;
  3. prefix_non_zero : bool;
  4. suffix : bool;
  5. zero_printing : zero_printing;
}

flags are passed to pretty printing functions to customize the output.

val default : flags

A default set of flags.

val make_flags : ?zero_padding:bool -> ?left_padding:bool -> ?separators:bool -> ?prefix:bool -> ?suffix:bool -> ?zero_special:bool -> unit -> flags

A function for creating flags. The left_padding prameter is ignored if zero_padding is set to true. The default values are as follows.

  • zero_padding=true
  • left_padding=false
  • separators=true
  • prefix=true
  • suffix=true
  • zero_special=false
OCaml

Innovation. Community. Security.