module UnliftExcept where
import Control.Monad.Except
import UnliftIO
instance (MonadUnliftIO m, Exception e) => MonadUnliftIO (ExceptT e m) where
withRunInIO exceptToIO = ExceptT $ try $ do
withRunInIO $ \runInIO ->
exceptToIO (runInIO . (either throwIO pure <=< runExceptT))
This is probably Bad for reasons I haven't figured out yet, but it works.
This is probably Bad for reasons I haven't figured out yet, but it works.