package regular

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type

Implement Printable interface from the minimum implementation.

Takes a module T, that provides a function pp : t printer and a module_name, and implements the rest of the Printable interface.

Parameters

module M : sig ... end

Signature

val to_string : M.t -> string

to_string x returns a human-readable representation of x

val str : unit -> M.t -> string

str () t is formatted output function that matches "%a" conversion format specifier in functions, that prints to string, e.g., sprintf, failwithf, errorf and, suprisingly all Lwt printing function, including Lwt_io.printf and logging (or any other function with type ('a,unit,string,...) formatN`. Example:

Or_error.errorf "type %a is not valid for %a"
Type.str ty Exp.str exp
val pps : unit -> M.t -> string

synonym for str

val ppo : Core_kernel.Std.Out_channel.t -> M.t -> unit

will print to a standard output_channel, useful for using in printf, fprintf, etc.

prints a sequence of values of type t

this will include pp function from Core that has type t printer, and can be used in Format.printf family of functions

include Core_kernel.Std.Pretty_printer.S with type t := M.t
val pp : Caml.Format.formatter -> M.t -> unit
OCaml

Innovation. Community. Security.