1 (* Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
4 * MLton is released under a BSD-style license.
5 * See the file MLton-LICENSE for details.
8 signature TRACE_CONTROL =
10 (* controls what tracing info is gathered *)
11 val always: unit -> unit (* always gather info *)
12 val flagged: unit -> unit (* only on flagged functions *)
13 val never: unit -> unit (* never gather info *)
15 (* value of newly created flag *)
18 (* turn on/off tracing for given functions *)
19 val on: string list -> unit
20 val off: string list -> unit
22 (* turn on/off tracing for all functions *)
24 val none: unit -> unit
26 (* returns functions that are on/off *)
27 val whatsOn: unit -> string list
28 val whatsOff: unit -> string list
43 * If !debug = Terminal, debugging messages are printed to /dev/tty.
44 * If !debug = Out os, then messages will be sent to os.
45 * If !debug = None, then messages will be ignored.
48 val message: Layout.t -> unit
49 val messageStr: string -> unit
50 (* inChildProcess is called by Process so that trace will know if it
51 * is in a child, and therefore it will prefix all messages with the
52 * pid of the current process.
54 val inChildProcess: unit -> unit
55 (* !showTime = true iff messages are preceded by the current time *)
56 val showTime: bool ref
63 structure Time: TRACE_CONTROL
65 val never: unit -> unit
66 val always: unit -> unit
67 val flagged: unit -> unit
68 val traceable: unit -> string list
69 val outputTraceable: unit -> unit
70 val reset: unit -> unit
72 (*---------- Delayed Feedback ----------*)
73 structure Computation: COMPUTATION
75 (* clear computation history *)
76 val clear: unit -> unit
78 (* get computation history *)
79 val computation: unit -> Computation.t
81 (* show computation history *)
82 val history: unit -> unit
84 (* show computation history, without arguments or results *)
85 val calls: unit -> unit
87 val times: unit -> unit
89 (* enter the inspector *)
90 val inspect: unit -> unit
92 (*---------- Instrumentation ----------*)
94 val traceCall: string -> ('a -> 'b) -> 'a -> 'b
97 val info: string -> info
103 * ('a -> bool * ('b -> bool))
114 (* type ('a, 'b) check = ('a -> Layout.t) * ('a -> bool * 'b)
117 * 'a -> ((unit -> Layout.t)
124 * * ('a, ('b, unit) check) check
130 val assertTrue: 'a -> (bool * ('b -> bool))
136 * ('a -> bool * ('b -> bool))
167 -> ('a * 'b * 'c -> 'd)
168 -> ('a * 'b * 'c -> 'd)
177 -> ('a * 'b * 'c * 'd -> 'e)
178 -> ('a * 'b * 'c * 'd -> 'e)
188 -> ('a * 'b * 'c * 'd * 'e -> 'f)
189 -> ('a * 'b * 'c * 'd * 'e -> 'f)
195 -> (('a -> 'b) -> ('a -> 'b))