Module Pp.Ty_repr

Pretty-print typed representations of OCaml values.

type t

An intermediate type representation suitable for printing.

type repr := t
module type REPRABLE = sig ... end
module type REPRABLE1 = sig ... end
val ignore : _ -> t

This never prints its argument.

Scalar types.

val int : int -> t
val string : string -> t
val float : float -> t

Linear sequences.

val seq : ('a -> t) -> 'a Stdlib.Seq.t -> t
module Linear (M : sig ... end) : REPRABLE1 with type 'a t = 'a M.t

Product types.

val tuple2 : ('a -> t) -> ('b -> t) -> ('a * 'b) -> t
val tuple3 : ('a -> t) -> ('b -> t) -> ('c -> t) -> ('a * 'b * 'c) -> t
type fields

Labeled arguments for record constructors.

val fields : string -> t -> fields
val field : string -> t -> fields -> fields
val record : fields -> t

Sum types.

type args

Positional arguments for variant constructors.

val args : t -> args
val (*) : args -> t -> args
val variant : string -> args -> t
val variant0 : string -> t
val polyvar : string -> args -> t
val polyvar0 : string -> t
val variantr : string -> fields -> t

Abstract types.

val abstract : string -> args -> t
val abstract0 : string -> t

Pretty-printing.

val pp : Stdlib.Format.formatter -> t -> unit

Stdlib conveniences.

val option : ('a -> t) -> 'a option -> t
val list : ('a -> t) -> 'a list -> t
val array : ('a -> t) -> 'a array -> t
module type ORDERED_REPR = sig ... end
module String : sig ... end
module Int : sig ... end
module Set (M : ORDERED_REPR) : REPRABLE with type t = Stdlib.Set.Make(M.Impl).t
module Map (M : ORDERED_REPR) : REPRABLE1 with type 'a t = 'a Stdlib.Map.Make(M.Impl).t