summaryrefslogtreecommitdiff
path: root/src/Codec/Archive/Common.hs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Codec/Archive/Common.hs')
-rw-r--r--src/Codec/Archive/Common.hs10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/Codec/Archive/Common.hs b/src/Codec/Archive/Common.hs
index b369e20..a1d1af2 100644
--- a/src/Codec/Archive/Common.hs
+++ b/src/Codec/Archive/Common.hs
@@ -4,7 +4,6 @@ module Codec.Archive.Common ( actFree
) where
import Codec.Archive.Foreign
-import Codec.Archive.Monad (ArchiveM, bracketM)
import Control.Composition ((.**))
import Control.Monad (void)
import Control.Monad.IO.Class (MonadIO (..))
@@ -20,10 +19,11 @@ hmemcpy :: Ptr a -> Ptr b -> CSize -> IO ()
hmemcpy = void .** memcpy
-- | Do something with an 'Archive' and then free it
-actFree :: IO (Ptr Archive)
- -> (Ptr Archive -> ArchiveM a)
- -> ArchiveM a
-actFree get = bracketM get archiveFree
+actFree :: MonadIO m
+ => (Ptr Archive -> m a)
+ -> Ptr Archive
+ -> m a
+actFree fact a = fact a <* liftIO (archiveFree a)
actFreeCallback :: MonadIO m
=> (Ptr Archive -> m a)