diff options
Diffstat (limited to 'lib/future.ml')
-rw-r--r-- | lib/future.ml | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/future.ml b/lib/future.ml index 1e9cada51..d8f7b3a94 100644 --- a/lib/future.ml +++ b/lib/future.ml @@ -111,6 +111,11 @@ let purify f x = v with e -> let e = Errors.push e in !unfreeze state; raise e +let transactify f x = + let state = !freeze () in + try f x + with e -> let e = Errors.push e in !unfreeze state; raise e + let purify_future f x = match !x with | Val _ | Exn _ | Delegated | Dropped -> f x |