Commit f4ed19bf authored by POTTIER Francois's avatar POTTIER Francois

Added [IO.try_finally].

parent 01148ac2
(* Input-output utilities. *)
(* ------------------------------------------------------------------------- *)
(* [try/finally]. *)
let try_finally action handler =
let result =
try
action()
with e ->
handler();
raise e
in
handler();
result
(* ------------------------------------------------------------------------- *)
(* [exhaust channel] reads all of the data that's available on [channel].
It does not assume that the length of the data is known ahead of time.
......
(* Input-output utilities. *)
(* [try/finally] *)
val try_finally : (unit -> 'a) -> (unit -> unit) -> 'a
(* [exhaust channel] reads all of the data that's available on [channel].
It does not assume that the length of the data is known ahead of time.
It does not close the channel. *)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment