comparison lib/print.mli @ 0:bfdcc3820b32

Basis
author Mike Spivey <mike@cs.ox.ac.uk>
date Thu, 05 Oct 2017 08:04:15 +0100
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:bfdcc3820b32
1 (* lib/print.mli *)
2 (* Copyright (c) 2017 J. M. Spivey *)
3
4 type arg
5
6 (* Basic formats *)
7 val fNum : int -> arg (* Decimal number *)
8 val fFix : int * int -> arg (* Fixed-width number (val, width) *)
9 val fFlo : float -> arg (* Floating-point number *)
10 val fStr : string -> arg (* String *)
11 val fChr : char -> arg (* Character *)
12 val fBool : bool -> arg (* Boolean *)
13
14 (* |fMeta| -- insert output of recursive call to |printf| *)
15 val fMeta : string -> arg list -> arg
16
17 (* |fExt| -- higher-order extension *)
18 val fExt : ((string -> arg list -> unit) -> unit) -> arg
19
20 (* |fList| -- format a comma-separated list *)
21 val fList : ('a -> arg) -> 'a list -> arg
22
23 (* |printf| -- print on standard output *)
24 val printf : string -> arg list -> unit
25
26 (* |fprintf| -- print to a file *)
27 val fprintf : out_channel -> string -> arg list -> unit
28
29 (* |sprintf| -- print to a string *)
30 val sprintf : string -> arg list -> string
31
32 (* |fgrindf| -- pretty-printer *)
33 val fgrindf : out_channel -> string -> string -> arg list -> unit
34
35 val do_print : (char -> unit) -> string -> arg list -> unit