1 (* Pasted from Pottier's PP compiler *)
3 (** This module provides printing utilities. *)
11 (* [nl] prints a newline character and a certain amount of
12 whitespace that reflects the current indentation level. *)
16 (* [indent ofs] transforms a printer into another printer
17 that indents material [ofs] characters to the right. *)
19 val indent: int -> 'a printer -> 'a printer
21 (* [list] prints a list without any delimiters. *)
23 val list: 'a printer -> 'a list printer
25 (* [preclist] prints a list where a delimiter precedes every
28 val preclist: punctuation -> 'a printer -> 'a list printer
30 (* [termlist] prints a list where a delimiter terminates every
33 val termlist: punctuation -> 'a printer -> 'a list printer
35 (* [seplist] prints a list where a separator separates every two
36 consecutive elements. *)
38 val seplist: punctuation -> 'a printer -> 'a list printer
40 (* [annlist] prints nothing if its list argument is empty, and prints
41 an announcement followed by the list if the list is nonempty. *)
43 val annlist: punctuation -> 'a list printer -> 'a list printer
47 val space: punctuation
48 val comma: punctuation
49 val semicolon: punctuation
51 val seminl: punctuation
52 val nlspace: int -> punctuation
55 (* [atmost n delimiter stop] normally prints a [delimiter], except that,
56 every [n] calls, it prints a [stop] in addition. *)
58 val atmost: int -> punctuation -> punctuation -> punctuation
60 (* [catenate] turns a list of columns into a single column, adding
61 padding (whitespace) to enforce alignment. *)
63 val catenate: string list list -> string list
65 (* [transposerev] turns a reversed list of lines into a list of columns. *)
67 val transposerev: string list list -> string list list
69 (* [showif flag printer x] displays [x] on standard output using
70 [printer] when [flag] is set. It returns [x]. *)
72 val showif: bool -> 'a printer -> 'a -> 'a