This commit is contained in:
Joey Hess 2013-05-19 12:43:44 -04:00
parent 667a832de9
commit 630a8b9ad2

View file

@ -18,7 +18,11 @@ import Control.Exception hiding (handle, try, throw)
import Common.Annex
{- Runs an Annex action, with setup and cleanup both in the IO monad. -}
{- Runs an Annex action, with setup and cleanup both in the IO monad.
-
- Warning: Currently if the Annex action fails, any changes it has made
- to Annex state are discarded.
-}
bracketIO :: IO c -> (c -> IO b) -> Annex a -> Annex a
bracketIO setup cleanup go =
liftBaseOp (Control.Exception.bracket setup cleanup) (const go)