mirror of
https://github.com/c-cube/ocaml-containers.git
synced 2025-12-06 03:05:28 -05:00
Document behaviour of Fun.finally when finaliser raises
This commit is contained in:
parent
beb38da150
commit
2d5f0e3e8d
1 changed files with 7 additions and 1 deletions
|
|
@ -58,16 +58,22 @@ val lexicographic : ('a -> 'a -> int) -> ('a -> 'a -> int) -> 'a -> 'a -> int
|
|||
val finally : h:(unit -> _) -> f:(unit -> 'a) -> 'a
|
||||
(** [finally h f] calls [f ()] and returns its result. If it raises, the
|
||||
same exception is raised; in {b any} case, [h ()] is called after
|
||||
[f ()] terminates. *)
|
||||
[f ()] terminates.
|
||||
If [h ()] raises an exception, then this exception will be passed on and
|
||||
any exception that may have been raised by [f ()] is lost. *)
|
||||
|
||||
val finally1 : h:(unit -> _) -> ('a -> 'b) -> 'a -> 'b
|
||||
(** [finally1 ~h f x] is the same as [f x], but after the computation,
|
||||
[h ()] is called whether [f x] rose an exception or not.
|
||||
If [h ()] raises an exception, then this exception will be passed on and
|
||||
any exception that may have been raised by [f ()] is lost.
|
||||
@since 0.16 *)
|
||||
|
||||
val finally2 : h:(unit -> _) -> ('a -> 'b -> 'c) -> 'a -> 'b -> 'c
|
||||
(** [finally2 ~h f x y] is the same as [f x y], but after the computation,
|
||||
[h ()] is called whether [f x y] rose an exception or not.
|
||||
If [h ()] raises an exception, then this exception will be passed on and
|
||||
any exception that may have been raised by [f ()] is lost.
|
||||
@since 0.16 *)
|
||||
|
||||
val opaque_identity : 'a -> 'a
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue