File: print_to_string.doc

package info (click to toggle)
hol-light 20190729-4
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 42,676 kB
  • sloc: ml: 637,078; cpp: 439; makefile: 301; lisp: 286; java: 279; sh: 239; yacc: 108; perl: 78; ansic: 57; sed: 39; python: 13
file content (30 lines) | stat: -rw-r--r-- 778 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
\DOC print_to_string

\TYPE {print_to_string : (formatter -> 'a -> 'b) -> 'a -> string}

\SYNOPSIS
Modifies a formatting printing function to return its output as a string.

\DESCRIBE
If {p} is a printing function whose first argument is a formatter (a standard
OCaml datatype indicating an output for printing functions), {print_to_string
P} gives a function that invokes it and collects and returns its output as a
string.

\FAILURE
Fails only if the core printing function fails.

\EXAMPLE
The standard function {string_of_term} is defined as:
{
  # let string_of_term = print_to_string pp_print_term;;
}

\USES
Converting a general printing function to a `convert to string' function, as in 
the example above.

\SEEALSO
pp_print_term, pp_print_thm, pp_print_type.

\ENDDOC