Merge pull request #629 from hamishmack/master

Derive MonadThrow and MonadCatch for ClientM
This commit is contained in:
Julian Arni 2016-10-27 12:23:14 +01:00 committed by GitHub
commit 67c26cb7bc

View file

@ -12,7 +12,7 @@ import Prelude.Compat
import Control.Exception import Control.Exception
import Control.Monad import Control.Monad
import Control.Monad.Catch (MonadThrow) import Control.Monad.Catch (MonadThrow, MonadCatch)
#if MIN_VERSION_mtl(2,2,0) #if MIN_VERSION_mtl(2,2,0)
import Control.Monad.Except (MonadError(..)) import Control.Monad.Except (MonadError(..))
@ -176,6 +176,7 @@ newtype ClientM a = ClientM { runClientM' :: ReaderT ClientEnv (ExceptT ServantE
deriving ( Functor, Applicative, Monad, MonadIO, Generic deriving ( Functor, Applicative, Monad, MonadIO, Generic
, MonadReader ClientEnv , MonadReader ClientEnv
, MonadError ServantError , MonadError ServantError
, MonadThrow, MonadCatch
) )
runClientM :: ClientM a -> ClientEnv -> IO (Either ServantError a) runClientM :: ClientM a -> ClientEnv -> IO (Either ServantError a)