        }

  return pa

pulseM :: ((a -> IO ()) -> (String -> IO ()) -> ReaderT PulseAudio IO ()) -> PulseM a
pulseM f = do
  pa <- lift ask
  contErrT $ \cont exit -> f (flip runReaderT pa . cont) (flip runReaderT pa . exit)

resetContext :: PulseM ()
resetContext = contErrT $ \cont exit -> do
  pa <- ask