diff options
author | Guillaume Munch-Maccagnoni <Guillaume.Munch-Maccagnoni@Inria.fr> | 2018-10-25 17:38:07 +0200 |
---|---|---|
committer | Guillaume Munch-Maccagnoni <Guillaume.Munch-Maccagnoni@Inria.fr> | 2019-02-03 12:27:27 +0100 |
commit | f68692ebc229af3e41818b91ab50c667cd0677db (patch) | |
tree | 4940961539dbd8fa2e82d0e4b35ebb9f9a5df8a5 /stdlib/stdlib.mli | |
parent | 23d582f58ea0e2cd6b9b9df808ea86780bb1b79d (diff) | |
download | ocaml-f68692ebc229af3e41818b91ab50c667cd0677db.tar.gz |
Improve protect
- Treat as an error the case where ~finally raises an exception
- Move to Fun module
- Describe the purpose in the documentation
- Remove boilerplate
https://github.com/ocaml/ocaml/pull/2118
Diffstat (limited to 'stdlib/stdlib.mli')
-rw-r--r-- | stdlib/stdlib.mli | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/stdlib/stdlib.mli b/stdlib/stdlib.mli index d2b97a2711..3ee5eb626c 100644 --- a/stdlib/stdlib.mli +++ b/stdlib/stdlib.mli @@ -44,15 +44,6 @@ exception Exit (** The [Exit] exception is not raised by any library function. It is provided for use in your programs. *) -val protect : finally:(unit -> unit) -> (unit -> 'a) -> 'a -(** [protect ~finally work] invokes [work ()] and then [finally ()] - before [work] returns with its value or an exception. In the latter - case the exception is re-raised after [finally ()]. - If [finally ()] raises, this exception is not caught and may shadow - one [work ()] may have raised. - - @since 4.08.0 *) - exception Match_failure of (string * int * int) [@ocaml.warn_on_literal_pattern] (** Exception raised when none of the cases of a pattern-matching |