Module Debug.Fmt

This submodule defines a record containing a higher-rank polymorphic function. We need this record type so that we can pass a partially-applied Format.fprintf function to client modules. We introduce the submodule so that client modules can selectively open it if they want to use the format-string support provided by Debug; this will bring into scope only the fmt type and the fmt projection for the record.

Clients can then write:

  let dprintf, _, _ = Debug.makeFunctions (Debug.toFlags [ 11 ])

  open Debug.Fmt

  let _ = dprintf (fun p -> p.fmt "%s %d" "hello" 4)
type fmt = {
  1. fmt : 'a. ('a, Format.formatter, unit) Stdlib.format -> 'a;
}