From cf499abada7a49ca105140e5fabf664a64d3054d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Fran=C3=A7ois=20Bobot?= <francois.bobot@cea.fr>
Date: Thu, 18 Jul 2013 19:12:20 +0200
Subject: [PATCH] [Pp] replace every Format.formatter -> 'foo -> unit by 'foo
 printer

---
 src/arith.mli                              |  2 +-
 src/conflict.ml                            | 18 +++++++++---------
 src/conflict.mli                           | 12 ++++++------
 src/explanation.ml                         |  4 ++--
 src/explanation.mli                        |  8 ++++----
 src/inputlang/altergo/symbols.mli          |  2 +-
 src/inputlang/altergo/why_ty.mli           |  8 ++++----
 src/inputlang/smtlib2/popop_of_smtlib2.mli |  2 +-
 src/solver.ml                              |  8 ++++----
 src/solver.mli                             | 14 +++++++-------
 src/types.ml                               | 10 +++++-----
 src/types.mli                              | 16 ++++++++--------
 src/util/bag.mli                           |  6 +++---
 src/util/debug.ml                          |  2 +-
 src/util/debug.mli                         |  2 +-
 src/util/exn_printer.ml                    |  4 ++--
 src/util/exn_printer.mli                   |  2 +-
 src/util/intmap.mli                        |  4 ++--
 src/util/intmap_hetero.ml                  | 20 ++++++++++----------
 src/util/intmap_hetero.mli                 | 16 ++++++++--------
 src/util/print_tree.mli                    |  4 ++--
 src/util/rc.mli                            |  2 +-
 src/util/stdlib.ml                         |  6 +++---
 src/util/stdlib.mli                        |  6 +++---
 src/util/strings.mli                       |  2 +-
 src/util/vector_hetero.ml                  | 20 ++++++++++----------
 src/util/vector_hetero.mli                 | 16 ++++++++--------
 src/util/weakhtbl.ml                       |  2 +-
 src/util/weakhtbl.mli                      |  2 +-
 29 files changed, 110 insertions(+), 110 deletions(-)

diff --git a/src/arith.mli b/src/arith.mli
index 1b71c4999..8790c94a8 100644
--- a/src/arith.mli
+++ b/src/arith.mli
@@ -45,5 +45,5 @@ module P: sig
   val x_p_cy: t -> Q.t -> t -> t
 end
 
-val print: Format.formatter -> p -> unit
+val print: p Pp.printer
 val sem: p sem
diff --git a/src/conflict.ml b/src/conflict.ml
index 7958d3e8c..a758d7522 100644
--- a/src/conflict.ml
+++ b/src/conflict.ml
@@ -106,7 +106,7 @@ module Rlist : sig
       em_repr_rl: rlist;
     }
 
-  val print: Format.formatter -> rlist -> unit
+  val print: rlist Pp.printer
 
   module Tmp : sig
     type tmppexpmerge_opt
@@ -144,8 +144,8 @@ module Rlist : sig
     val set_trl: tmprlist -> tmprlist -> unit
     val set_po : tmprlist -> tmppexpmerge -> unit
 
-    val print: Format.formatter -> tmprlist -> unit
-    val print_pexpmerge: Format.formatter -> tmppexpmerge -> unit
+    val print: tmprlist Pp.printer
+    val print_pexpmerge: tmppexpmerge Pp.printer
   end
 
   val conv: Tmp.tmprlist needed -> rlist needed
@@ -404,7 +404,7 @@ module type Con' = sig
 
   type t
 
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 
   val key: t con
 
@@ -449,7 +449,7 @@ module type Exp' = sig
 
   type t
 
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 
   val key: t exp
 
@@ -496,7 +496,7 @@ module type Cho' = sig
   module Key  : Stdlib.Datatype with type t = k
   module Data: sig
     type t = d
-    val print: Format.formatter -> t -> unit
+    val print: t Pp.printer
   end
 
   val choose_decision:
@@ -1164,7 +1164,7 @@ module type Exp = sig
 
     type t
 
-    val print: Format.formatter -> t -> unit
+    val print: t Pp.printer
 
     val key: t exp
 
@@ -1189,7 +1189,7 @@ module type Con = sig
 
   type t
 
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 
   val key: t con
 
@@ -1232,7 +1232,7 @@ module type Cho = sig
   module Key  : Stdlib.Datatype
   module Data: sig
     type t
-    val print: Format.formatter -> t -> unit
+    val print: t Pp.printer
   end
 
   val choose_decision:
diff --git a/src/conflict.mli b/src/conflict.mli
index fc9177e82..9c0095e79 100644
--- a/src/conflict.mli
+++ b/src/conflict.mli
@@ -122,7 +122,7 @@ module type Exp = sig
 
   type t
 
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 
   val key: t exp
 
@@ -146,13 +146,13 @@ class type finalized = object
   method test: Solver.Delayed.t -> testconflict
 end
 
-val print_finalized: Format.formatter -> finalized -> unit
+val print_finalized: finalized Pp.printer
 
 module type Con = sig
 
   type t
 
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 
   val key: t con
 
@@ -189,7 +189,7 @@ module type Cho = sig
   module Key  : Stdlib.Datatype
   module Data: sig
     type t
-    val print: Format.formatter -> t -> unit
+    val print: t Pp.printer
   end
 
   val choose_decision:
@@ -218,8 +218,8 @@ val choose_decision:
   (Solver.Delayed.t -> dec -> unit) decdone
 
 
-val print_pexp: Format.formatter -> pexp -> unit
-val print_chogen: Format.formatter -> Explanation.chogen -> unit
+val print_pexp: pexp Pp.printer
+val print_chogen: Explanation.chogen Pp.printer
 
 val check_initialization: unit -> bool
 (** Check if the initialization of all the exp, con have been done *)
diff --git a/src/explanation.ml b/src/explanation.ml
index 2118c735b..f5af86453 100644
--- a/src/explanation.ml
+++ b/src/explanation.ml
@@ -58,7 +58,7 @@ module Tags : sig
   val add: t -> 'a tag -> 'a Bag.t -> t
   val find: t -> 'a tag -> 'a Bag.t
   val union: t -> t -> t
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 end = struct
   type exi
   type t = exi Bag.t Tag.K.M.t
@@ -152,7 +152,7 @@ type concache = Concache.t
 type pexp =
 | Pexp: age * 'a exp * 'a * tags * concache -> pexp
 
-let print_pexp : (Format.formatter -> pexp -> unit) ref =
+let print_pexp : (pexp Pp.printer) ref =
   ref (fun _ _ -> assert false)
 
 type modif =
diff --git a/src/explanation.mli b/src/explanation.mli
index 068b016da..f382e21bf 100644
--- a/src/explanation.mli
+++ b/src/explanation.mli
@@ -32,7 +32,7 @@ module Tags : sig
   val add: t -> 'a tag -> 'a Bag.t -> t
   val find: t -> 'a tag -> 'a Bag.t
   val union: t -> t -> t
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 end
 type tags = Tags.t
 
@@ -92,7 +92,7 @@ type direct =
   | DirectDom : 'a dom * Cl.t -> direct
 
 val expdirect: direct exp
-val print_direct: Format.formatter -> direct -> unit
+val print_direct: direct Pp.printer
 (* TODO other direct *)
 
 
@@ -100,7 +100,7 @@ type dec
 
 val mk_pcho: dec -> ('k,'d) cho -> 'k -> 'd -> pexp
 
-val print_dec: Format.formatter -> dec -> unit
+val print_dec: dec Pp.printer
 val age_of_dec: dec -> age
 val new_dec: t -> dec
 
@@ -178,4 +178,4 @@ type pcho =
 val expcho: pcho exp
 val expfact: unit exp
 
-val print_pexp : (Format.formatter -> pexp -> unit) ref
+val print_pexp : (pexp Pp.printer) ref
diff --git a/src/inputlang/altergo/symbols.mli b/src/inputlang/altergo/symbols.mli
index eca619020..916c31027 100644
--- a/src/inputlang/altergo/symbols.mli
+++ b/src/inputlang/altergo/symbols.mli
@@ -47,7 +47,7 @@ val compare : t -> t -> int
 val hash : t -> int
 
 val to_string : t -> string
-val print : Format.formatter -> t -> unit
+val print : t Pp.printer
 
 val dummy : t
 
diff --git a/src/inputlang/altergo/why_ty.mli b/src/inputlang/altergo/why_ty.mli
index fd9468d00..7ab10ad27 100644
--- a/src/inputlang/altergo/why_ty.mli
+++ b/src/inputlang/altergo/why_ty.mli
@@ -74,9 +74,9 @@ val union_subst : subst -> subst -> subst
 
 val compare_subst : subst -> subst -> int
 
-val print : Format.formatter -> t -> unit
-val print_full : Format.formatter -> t -> unit
-(*val printl : Format.formatter -> t list -> unit*)
+val print : t Pp.printer
+val print_full : t Pp.printer
+(*val printl : t list Pp.printer*)
 
 module Svty : Set.S
 
@@ -84,4 +84,4 @@ val vty_of : t -> Svty.t
 
 val monomorphize: t -> t
 
-val print_subst: Format.formatter -> subst -> unit
+val print_subst: subst Pp.printer
diff --git a/src/inputlang/smtlib2/popop_of_smtlib2.mli b/src/inputlang/smtlib2/popop_of_smtlib2.mli
index fa0c1a8fb..e906b1e80 100644
--- a/src/inputlang/smtlib2/popop_of_smtlib2.mli
+++ b/src/inputlang/smtlib2/popop_of_smtlib2.mli
@@ -31,4 +31,4 @@ type status =
 
 val check_file: Smtlib2_ast.commands -> status
 
-val print_status: Format.formatter -> status -> unit
+val print_status: status Pp.printer
diff --git a/src/solver.ml b/src/solver.ml
index e8fa4ea70..1dc1c8a43 100644
--- a/src/solver.ml
+++ b/src/solver.ml
@@ -60,7 +60,7 @@ module Events = struct
 
   module type UserEvent = sig
     type t
-    val print: Format.formatter -> t -> unit
+    val print: t Pp.printer
     val key: t user_event
   end
 
@@ -225,7 +225,7 @@ module type Sem' = sig
   module M : Map.S with type key = t
   module S : M.Set
   module H : XHashtbl.S with type key = t
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
   val key: t sem
 end
 
@@ -243,7 +243,7 @@ module type Dem' = sig
 
   module Data: sig
     type t = d
-    val print: Format.formatter -> t -> unit
+    val print: t Pp.printer
   end
 
   val key: (Key.t, Data.t) dem
@@ -260,7 +260,7 @@ module type DemFast' = sig
 
   module Data: sig
     type t = d
-    val print: Format.formatter -> t -> unit
+    val print: t Pp.printer
   end
 
   val key: (unit, Data.t) dem
diff --git a/src/solver.mli b/src/solver.mli
index f26eeaa0d..9660a70fe 100644
--- a/src/solver.mli
+++ b/src/solver.mli
@@ -43,7 +43,7 @@ module Events : sig
     | EventChange   : Cl.t           * 'b -> 'b event
     | EventPropaSem :        'a sem  * 'b -> 'b event
 
-    val print: Format.formatter -> 'b event -> unit
+    val print: 'b event Pp.printer
 
     type 'b t = 'b event list
   end
@@ -65,7 +65,7 @@ module Events : sig
     (** a new semantical value 'a appear *)
     | EventPropaSem : Cl.t * 'a sem  * 'a * 'b -> 'b event
 
-    val print: Format.formatter -> 'b event -> unit
+    val print: 'b event Pp.printer
 
     type 'b t = 'b event list
 
@@ -184,7 +184,7 @@ module type Sem = sig
   module M : Map.S with type key = t
   module S : M.Set
   module H : XHashtbl.S with type key = t
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 
   val key: t sem
 end
@@ -205,7 +205,7 @@ module type Dem = sig
 
   module Data: sig
     type t = d
-    val print: Format.formatter -> t -> unit
+    val print: t Pp.printer
   end
 
   val key: (Key.t, Data.t) dem
@@ -222,7 +222,7 @@ module type DemFast = sig
 
   module Data: sig
     type t = d
-    val print: Format.formatter -> t -> unit
+    val print: t Pp.printer
   end
 
   val key: (unit, Data.t) dem
@@ -304,5 +304,5 @@ val output_graph : string -> t -> unit
 val check_initialization: unit -> bool
 (** Check if the initialization of all the dom, sem and dem have been done *)
 
-val print_sem: 'a sem -> Format.formatter -> 'a -> unit
-val print_dom: 'a dom -> Format.formatter -> 'a -> unit
+val print_sem: 'a sem -> 'a Pp.printer
+val print_dom: 'a dom -> 'a Pp.printer
diff --git a/src/types.ml b/src/types.ml
index a74f58526..02933fc05 100644
--- a/src/types.ml
+++ b/src/types.ml
@@ -38,7 +38,7 @@ module type Key = sig
 
   module K: Datatype
   type 'a k = private K.t
-  val print: Format.formatter -> 'a k -> unit
+  val print: 'a k Pp.printer
   val equal: 'a k -> 'b k -> bool
   val hash : 'a k -> int
 
@@ -96,7 +96,7 @@ module type Key2 = sig
   module K: Datatype
   type ('k,'d) k = private K.t
   (** kind of daemon for semantic value of type 'a *)
-  val print: Format.formatter -> ('k,'d) k -> unit
+  val print: ('k,'d) k Pp.printer
   val equal: ('k1,'d1) k -> ('k2,'d2) k -> bool
   val hash : ('k,'d) k -> int
 
@@ -134,21 +134,21 @@ type ('k,'d) dem = ('k,'d) Dem.k
 
 
 module Print = struct (** Cutting the knot for printer *)
-  type psem = { mutable psem : 'a. ('a sem -> Format.formatter -> 'a -> unit)}
+  type psem = { mutable psem : 'a. ('a sem -> 'a Pp.printer)}
 
   let psem : psem =
     {psem = fun _ _ _ -> assert false} (** called too early *)
   let sem sem fmt s = psem.psem sem fmt s
 
   type pdem_key = { mutable
-      pdem_key : 'k 'd. ('k,'d) dem -> Format.formatter -> 'k -> unit}
+      pdem_key : 'k 'd. ('k,'d) dem -> 'k Pp.printer}
 
   let pdem_key : pdem_key =
     {pdem_key = fun _ _ _ -> assert false} (** called too early *)
   let dem_key dem fmt s = pdem_key.pdem_key dem fmt s
 
   type pdem_data = { mutable
-      pdem_data : 'k 'd. ('k,'d) dem -> Format.formatter -> 'd -> unit}
+      pdem_data : 'k 'd. ('k,'d) dem -> 'd Pp.printer}
 
   let pdem_data : pdem_data =
     {pdem_data = fun _ _ _ -> assert false} (** called too early *)
diff --git a/src/types.mli b/src/types.mli
index 383541fe5..3d4ba6cce 100644
--- a/src/types.mli
+++ b/src/types.mli
@@ -50,7 +50,7 @@ module type Key = sig
   module K: Datatype
   type 'a k = private K.t
 
-  val print: Format.formatter -> 'a k -> unit
+  val print: 'a k Pp.printer
   val equal: 'a k -> 'b k -> bool
   val hash : 'a k -> int
 
@@ -87,7 +87,7 @@ module type Key2 = sig
   module K: Datatype
   type ('k,'d) k = private K.t
   (** kind of daemon for semantic value of type 'a *)
-  val print: Format.formatter -> ('k,'d) k -> unit
+  val print: ('k,'d) k Pp.printer
   val equal: ('k1,'d1) k -> ('k2,'d2) k -> bool
   val hash : ('k,'d) k -> int
 
@@ -109,22 +109,22 @@ type ('k,'d) dem = ('k,'d) Dem.k
 
 module Print : sig (** Cutting the knot for printer *)
   type psem =
-    { mutable psem : 'a. ('a sem -> Format.formatter -> 'a -> unit)}
+    { mutable psem : 'a. ('a sem -> 'a Pp.printer)}
 
   val psem : psem
-  val sem : 'a sem -> Format.formatter -> 'a -> unit
+  val sem : 'a sem -> 'a Pp.printer
 
   type pdem_key =
-    { mutable pdem_key : 'k 'd. ('k,'d) dem -> Format.formatter -> 'k -> unit}
+    { mutable pdem_key : 'k 'd. ('k,'d) dem -> 'k Pp.printer}
 
   val pdem_key : pdem_key
-  val dem_key : ('k,'d) dem -> Format.formatter -> 'k -> unit
+  val dem_key : ('k,'d) dem -> 'k Pp.printer
 
   type pdem_data = { mutable
-      pdem_data : 'k 'd. ('k,'d) dem -> Format.formatter -> 'd -> unit}
+      pdem_data : 'k 'd. ('k,'d) dem -> 'd Pp.printer}
 
   val pdem_data : pdem_data
-  val dem_data : ('k,'d) dem -> Format.formatter -> 'd -> unit
+  val dem_data : ('k,'d) dem -> 'd Pp.printer
 
 
 end
diff --git a/src/util/bag.mli b/src/util/bag.mli
index c3587179f..2363f3475 100644
--- a/src/util/bag.mli
+++ b/src/util/bag.mli
@@ -52,6 +52,6 @@ val elements : 'a t -> 'a list
 
 
 val print:
-  (Format.formatter -> unit -> unit) ->
-  (Format.formatter -> 'a -> unit) ->
-  Format.formatter -> 'a t -> unit
+  (unit Pp.printer) ->
+  ('a Pp.printer) ->
+  'a t Pp.printer
diff --git a/src/util/debug.ml b/src/util/debug.ml
index f01528d14..cbaf625db 100644
--- a/src/util/debug.ml
+++ b/src/util/debug.ml
@@ -183,7 +183,7 @@ let max_name_size = ref 0
 
 
 type stats =
-| Stat : (Format.formatter -> 'a -> unit) * string * 'a ref -> stats
+| Stat : ('a Pp.printer) * string * 'a ref -> stats
 
 let registered_stats : stats list ref = ref []
 
diff --git a/src/util/debug.mli b/src/util/debug.mli
index cc8287390..49b24530d 100644
--- a/src/util/debug.mli
+++ b/src/util/debug.mli
@@ -135,7 +135,7 @@ val stats: flag
 type 'a stat
 
 val register_stats :
-  print:(Format.formatter -> 'a -> unit) ->
+  print:('a Pp.printer) ->
   name:string ->
   init:'a -> 'a stat
 
diff --git a/src/util/exn_printer.ml b/src/util/exn_printer.ml
index 36e869314..8ef435952 100644
--- a/src/util/exn_printer.ml
+++ b/src/util/exn_printer.ml
@@ -9,10 +9,10 @@
 (*                                                                  *)
 (********************************************************************)
 
-type exn_printer = Format.formatter -> exn -> unit
+type exn_printer = exn Pp.printer
 
 let exn_printers =
-  (Stack.create () : (Format.formatter -> exn -> unit) Stack.t)
+  (Stack.create () : (exn Pp.printer) Stack.t)
 
 let register exn_printer = Stack.push exn_printer exn_printers
 
diff --git a/src/util/exn_printer.mli b/src/util/exn_printer.mli
index dc8d181d3..d4c271d77 100644
--- a/src/util/exn_printer.mli
+++ b/src/util/exn_printer.mli
@@ -9,7 +9,7 @@
 (*                                                                  *)
 (********************************************************************)
 
-type exn_printer = Format.formatter -> exn -> unit
+type exn_printer = exn Pp.printer
 (* an [exn_printer] is a formatter of exception which prints on the
    given formatter a message for the user if it knows the given
    exception. Otherwise it raises the exception *)
diff --git a/src/util/intmap.mli b/src/util/intmap.mli
index 860dde6ec..04e3e7957 100644
--- a/src/util/intmap.mli
+++ b/src/util/intmap.mli
@@ -65,5 +65,5 @@ val merge : (int -> 'a option -> 'b option -> 'c option) -> 'a t -> 'b t -> 'c t
 val iter2 : (int -> 'a option -> 'b option -> unit) -> 'a t -> 'b t -> unit
 val iterk : (int -> 'a -> 'b -> unit) -> 'a t -> 'b t -> unit
 
-val pp_bits : Format.formatter -> int -> unit
-val pp_tree : string -> Format.formatter -> 'a t -> unit
+val pp_bits : int Pp.printer
+val pp_tree : string -> 'a t Pp.printer
diff --git a/src/util/intmap_hetero.ml b/src/util/intmap_hetero.ml
index 7f5450ffb..cefbcfb7a 100644
--- a/src/util/intmap_hetero.ml
+++ b/src/util/intmap_hetero.ml
@@ -62,11 +62,11 @@ module type S1 = sig
   type ('b,'c) fold = { fold: 'a. 'c -> 'a key -> ('a,'b) data -> 'c }
   val fold : ('b,'c) fold -> 'c -> 'b t -> 'c
 
-  type 'b print = { print: 'a. Format.formatter -> ('a,'b) data -> unit }
+  type 'b print = { print: 'a. ('a,'b) data Pp.printer }
   val print:
-    (Format.formatter -> unit -> unit) ->
+    (unit Pp.printer) ->
     'b print ->
-    Format.formatter -> 'b t -> unit
+    'b t Pp.printer
 
 end
 
@@ -146,7 +146,7 @@ module Make1
         (Obj.magic (i : int) :> exi K.t) (* same thing than for iteri *)
         d) acc t
 
-  type 'b print = { print: 'a. Format.formatter -> ('a,'b) data -> unit }
+  type 'b print = { print: 'a. ('a,'b) data Pp.printer }
   let print sep print fmt t =
     Pp.print_iter2 Intmap.iter Pp.nothing sep Pp.nothing print.print fmt t
 
@@ -192,20 +192,20 @@ module type R1 = sig
   type ('b,'c) fold = { fold: 'a. 'c -> 'a key -> 'b -> 'c }
   val fold : ('b,'c) fold -> 'c -> 'b t -> 'c
 
-  type printk = { printk: 'a. Format.formatter -> 'a key -> unit }
+  type printk = { printk: 'a. 'a key Pp.printer }
   val print:
-    (Format.formatter -> unit -> unit) ->
-    (Format.formatter -> unit -> unit) ->
+    (unit Pp.printer) ->
+    (unit Pp.printer) ->
     printk ->
-    (Format.formatter -> 'b -> unit) ->
-    Format.formatter -> 'b t -> unit
+    ('b Pp.printer) ->
+    'b t Pp.printer
 
 end
 
 module RMake1 (K:sig type 'a t = private int end) = struct
   include Make1(K)(struct type ('a,'b) t = 'b end)
 
-  type printk = { printk: 'a. Format.formatter -> 'a key -> unit }
+  type printk = { printk: 'a. 'a key Pp.printer }
 
   let print sep1 sep2 printkey print fmt (t : 'b t) =
     let printkey fmt i =
diff --git a/src/util/intmap_hetero.mli b/src/util/intmap_hetero.mli
index 5eb2b0f92..6b2d46a74 100644
--- a/src/util/intmap_hetero.mli
+++ b/src/util/intmap_hetero.mli
@@ -62,11 +62,11 @@ module type S1 = sig
   type ('b,'c) fold = { fold: 'a. 'c -> 'a key -> ('a,'b) data -> 'c }
   val fold : ('b,'c) fold -> 'c -> 'b t -> 'c
 
-  type 'b print = { print: 'a. Format.formatter -> ('a,'b) data -> unit }
+  type 'b print = { print: 'a. ('a,'b) data Pp.printer }
   val print:
-    (Format.formatter -> unit -> unit) ->
+    (unit Pp.printer) ->
     'b print ->
-    Format.formatter -> 'b t -> unit
+    'b t Pp.printer
 
 end
 
@@ -125,13 +125,13 @@ module type R1 = sig
   type ('b,'c) fold = { fold: 'a. 'c -> 'a key -> 'b -> 'c }
   val fold : ('b,'c) fold -> 'c -> 'b t -> 'c
 
-  type printk = { printk: 'a. Format.formatter -> 'a key -> unit }
+  type printk = { printk: 'a. 'a key Pp.printer }
   val print:
-    (Format.formatter -> unit -> unit) ->
-    (Format.formatter -> unit -> unit) ->
+    (unit Pp.printer) ->
+    (unit Pp.printer) ->
     printk ->
-    (Format.formatter -> 'b -> unit) ->
-    Format.formatter -> 'b t -> unit
+    ('b Pp.printer) ->
+    'b t Pp.printer
 
 end
 
diff --git a/src/util/print_tree.mli b/src/util/print_tree.mli
index 51955ad92..67ccf5177 100644
--- a/src/util/print_tree.mli
+++ b/src/util/print_tree.mli
@@ -33,7 +33,7 @@ end
     given formatter. *)
 
 module Make (T : Tree) : sig
-  val print : Format.formatter -> T.t -> unit
+  val print : T.t Pp.printer
 end
 
 
@@ -48,5 +48,5 @@ end
     given formatter. *)
 
 module PMake (T : PTree) : sig
-  val print : Format.formatter -> 'a T.t -> unit
+  val print : 'a T.t Pp.printer
 end
diff --git a/src/util/rc.mli b/src/util/rc.mli
index cfda0039a..cdb3f08ab 100644
--- a/src/util/rc.mli
+++ b/src/util/rc.mli
@@ -206,7 +206,7 @@ val from_file : string -> t
     @raise ExtraParameters if a section header has more than one argument
 *)
 
-val to_formatter : Format.formatter -> t -> unit
+val to_formatter : t Pp.printer
   (** [to_formatter fmt rc] writes the Rc [rc] to the formatter [fmt] *)
 
 val to_channel : out_channel -> t -> unit
diff --git a/src/util/stdlib.ml b/src/util/stdlib.ml
index 5637c51c2..e62fa8fde 100644
--- a/src/util/stdlib.ml
+++ b/src/util/stdlib.ml
@@ -18,7 +18,7 @@ module type TaggedType =
 sig
   type t
   val tag : t -> int
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 end
 
 module type OrderedHashedType =
@@ -27,7 +27,7 @@ sig
   val hash : t -> int
   val equal : t -> t -> bool
   val compare : t -> t -> int
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 end
 
 module OrderedHashed (X : TaggedType) =
@@ -80,7 +80,7 @@ module type Datatype = sig
   module M : Map.S with type key = t
   module S : M.Set
   module H : XHashtbl.S with type key = t
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 end
 
 (* Set, Map, Hashtbl on ints and strings *)
diff --git a/src/util/stdlib.mli b/src/util/stdlib.mli
index 37fc9b0f4..ee0589716 100644
--- a/src/util/stdlib.mli
+++ b/src/util/stdlib.mli
@@ -18,7 +18,7 @@ module type TaggedType =
 sig
   type t
   val tag : t -> int
-  val print:  Format.formatter -> t -> unit
+  val print:  t Pp.printer
 end
 
 module type OrderedHashedType =
@@ -27,7 +27,7 @@ sig
   val hash : t -> int
   val equal : t -> t -> bool
   val compare : t -> t -> int
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 end
 
 module type Datatype = sig
@@ -35,7 +35,7 @@ module type Datatype = sig
   module M : Map.S with type key = t
   module S : M.Set
   module H : XHashtbl.S with type key = t
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 end
 
 module OrderedHashed (X : TaggedType) :
diff --git a/src/util/strings.mli b/src/util/strings.mli
index 80d921c1d..3077bf4d7 100644
--- a/src/util/strings.mli
+++ b/src/util/strings.mli
@@ -29,7 +29,7 @@ module Hashcons :
   val fresh: string -> t (** always fresh *)
   val view: t -> string
   val tag: t -> int
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 end
 
 module Make (X : sig end): module type of Hashcons
diff --git a/src/util/vector_hetero.ml b/src/util/vector_hetero.ml
index f130c4994..c120304b1 100644
--- a/src/util/vector_hetero.ml
+++ b/src/util/vector_hetero.ml
@@ -57,11 +57,11 @@ module type S1 = sig
   val copy : 'b t -> 'b t
   (* shallow *)
 
-  type 'b print = { print: 'a. Format.formatter -> ('a,'b) data -> unit }
+  type 'b print = { print: 'a. ('a,'b) data Pp.printer }
   val print:
-    (Format.formatter -> unit -> unit) ->
+    unit Pp.printer ->
     'b print ->
-    Format.formatter -> 'b t -> unit
+    'b t Pp.printer
 
 end
 
@@ -132,7 +132,7 @@ module Make1
   let copy = Simple_vector.copy
   (* shallow *)
 
-  type 'b print = { print: 'a. Format.formatter -> ('a,'b) data -> unit }
+  type 'b print = { print: 'a. ('a,'b) data Pp.printer }
   let print sep print fmt t =
     Pp.print_iter1 Simple_vector.iter_initialized sep print.print fmt t
 
@@ -283,13 +283,13 @@ module type R1 = sig
   (* shallow *)
 
 
-  type printk = { printk: 'a. Format.formatter -> 'a key -> unit }
+  type printk = { printk: 'a. 'a key Pp.printer }
   val print:
-    (Format.formatter -> unit -> unit) ->
-    (Format.formatter -> unit -> unit) ->
+    unit Pp.printer ->
+    unit Pp.printer ->
     printk ->
-    (Format.formatter -> 'b -> unit) ->
-    Format.formatter -> 'b t -> unit
+    'b Pp.printer ->
+    'b t Pp.printer
 
 end
 
@@ -300,7 +300,7 @@ module RMake1 (K:sig type 'a t = private int end) = struct
 
   let fold_initialized f acc v = Simple_vector.fold_initialized f acc v
 
-  type printk = { printk: 'a. Format.formatter -> 'a key -> unit }
+  type printk = { printk: 'a. 'a key Pp.printer }
 
   let print sep1 sep2 printkey print fmt t =
     let printkey fmt i =
diff --git a/src/util/vector_hetero.mli b/src/util/vector_hetero.mli
index 30f8aabce..e155bdd15 100644
--- a/src/util/vector_hetero.mli
+++ b/src/util/vector_hetero.mli
@@ -59,11 +59,11 @@ module type S1 = sig
   val copy : 'b t -> 'b t
   (* shallow *)
 
-  type 'b print = { print: 'a. Format.formatter -> ('a,'b) data -> unit }
+  type 'b print = { print: 'a. ('a,'b) data Pp.printer }
   val print:
-    (Format.formatter -> unit -> unit) ->
+    (unit Pp.printer) ->
     'b print ->
-    Format.formatter -> 'b t -> unit
+    'b t Pp.printer
 
 end
 
@@ -159,13 +159,13 @@ module type R1 = sig
   val copy : 'b t -> 'b t
   (* shallow *)
 
-  type printk = { printk: 'a. Format.formatter -> 'a key -> unit }
+  type printk = { printk: 'a. 'a key Pp.printer }
   val print:
-    (Format.formatter -> unit -> unit) ->
-    (Format.formatter -> unit -> unit) ->
+    (unit Pp.printer) ->
+    (unit Pp.printer) ->
     printk ->
-    (Format.formatter -> 'b -> unit) ->
-    Format.formatter -> 'b t -> unit
+    ('b Pp.printer) ->
+    'b t Pp.printer
 
 end
 
diff --git a/src/util/weakhtbl.ml b/src/util/weakhtbl.ml
index 2fce05f15..447dc52c8 100644
--- a/src/util/weakhtbl.ml
+++ b/src/util/weakhtbl.ml
@@ -115,7 +115,7 @@ module type Weakey =
 sig
   type t
   val tag : t -> tag
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 end
 
 module Make (S : Weakey) = struct
diff --git a/src/util/weakhtbl.mli b/src/util/weakhtbl.mli
index 01a26be1b..01dd6abb9 100644
--- a/src/util/weakhtbl.mli
+++ b/src/util/weakhtbl.mli
@@ -72,7 +72,7 @@ module type Weakey =
 sig
   type t
   val tag : t -> tag
-  val print: Format.formatter -> t -> unit
+  val print: t Pp.printer
 end
 
 module Make (S : Weakey) : S with type key = S.t
-- 
GitLab