diff options
| author | Emilio Jesus Gallego Arias | 2017-11-24 18:43:12 +0100 |
|---|---|---|
| committer | Emilio Jesus Gallego Arias | 2017-11-24 22:04:26 +0100 |
| commit | aa560c640eb3f1148c87c4343900138845729105 (patch) | |
| tree | 709db53a99baabbe8f7984396d86128b70dd4f8a /lib/control.mli | |
| parent | c1e670b386f83ed78104a6eb6e4d17cc1d906439 (diff) | |
[lib] Generalize Control.timeout type.
We also remove some internal implementation details from the mli file,
there due historical reasons.
Diffstat (limited to 'lib/control.mli')
| -rw-r--r-- | lib/control.mli | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/lib/control.mli b/lib/control.mli index 337cdf67b0..f6c63ffb34 100644 --- a/lib/control.mli +++ b/lib/control.mli @@ -16,11 +16,6 @@ val check_for_interrupt : unit -> unit (** Use this function as a potential yield function. If {!interrupt} has been set, il will raise [Sys.Break]. *) -val timeout : int -> (unit -> 'a) -> exn -> 'a -(** [timeout n f e] tries to compute [f], and if it fails to do so before [n] - seconds, it raises [e] instead. *) - -type timeout = { timeout : 'a. int -> (unit -> 'a) -> exn -> 'a } - -val set_timeout : timeout -> unit -(** Set a particular timeout function. *) +val timeout : int -> ('a -> 'b) -> 'a -> exn -> 'b +(** [timeout n f x e] tries to compute [f x], and if it fails to do so + before [n] seconds, it raises [e] instead. *) |
