sig
  type t = Monitor.t
  type 'a with_optional_monitor_name =
      ?here:Core.Std.Source_code_position.t ->
      ?info:Core.Std.Info.t -> ?name:string -> 'a
  val create : (unit -> t) with_optional_monitor_name
  val name : t -> Core.Std.Info.t
  val current : unit -> t
  val errors : t -> exn Tail.Stream.t
  val error : t -> exn Deferred.t
  val extract_exn : exn -> exn
  val has_seen_error : t -> bool
  val send_exn : t -> ?backtrace:[ `Get | `This of string ] -> exn -> unit
  val try_with :
    (?run:[ `Now | `Schedule ] ->
     ?rest:[ `Ignore | `Raise ] ->
     (unit -> 'Deferred.t) -> ('a, exn) Core.Std.Result.t Deferred.t)
    with_optional_monitor_name
  val handle_errors :
    ((unit -> 'Deferred.t) -> (exn -> unit) -> 'Deferred.t)
    with_optional_monitor_name
  val catch_stream :
    ((unit -> unit) -> exn Tail.Stream.t) with_optional_monitor_name
  val catch : ((unit -> unit) -> exn Deferred.t) with_optional_monitor_name
  val protect :
    ((unit -> 'Deferred.t) ->
     finally:(unit -> unit Deferred.t) -> 'Deferred.t)
    with_optional_monitor_name
  val main : t
  module Exported_for_scheduler :
    sig
      type 'a with_options =
          ?work_group:Work_group.t ->
          ?monitor:t -> ?priority:Priority.t -> 'a
      val within' : ((unit -> 'Deferred.t) -> 'Deferred.t) with_options
      val within : ((unit -> unit) -> unit) with_options
      val within_v : ((unit -> 'a) -> 'a option) with_options
      val schedule' : ((unit -> 'Deferred.t) -> 'Deferred.t) with_options
      val schedule : ((unit -> unit) -> unit) with_options
      val within_context :
        Execution_context.t -> (unit -> 'a) -> ('a, unit) Core.Std.Result.t
    end
  val sexp_of_t : t -> Sexplib.Sexp.t
end