sig val terminate : bool -> exn -> unit end