liftIO package:monad-peel

liftIOOp is a particular application of peelIO that allows lifting control operations of type (a -> IO b) -> IO b (e.g. alloca, withMVar v) to MonadPeelIO m => (a -> m b) -> m b.
liftIOOp f g = do
k <- peelIO
join $ liftIO $ f (k . g)
liftIOOp_ is a particular application of peelIO that allows lifting control operations of type IO a -> IO a (e.g. block) to MonadPeelIO m => m a -> m a.
liftIOOp_ f m = do
k <- peelIO
join $ liftIO $ f (k m)