mirror of
https://github.com/freckle/yesod-auth-oauth2.git
synced 2026-08-25 06:03:50 +02:00
Newer Control.Monad.Except no longer re-exports these things. Using targeted imports keeps this working in those versions.
13 lines
387 B
Haskell
13 lines
387 B
Haskell
{-# OPTIONS_GHC -Wno-orphans #-}
|
|
|
|
module UnliftIO.Except () where
|
|
|
|
import Control.Monad ((<=<))
|
|
import Control.Monad.Except (ExceptT (..), runExceptT)
|
|
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))
|