git.iko.soy/typeable/swagger2
on master help sign in
remove ErrorT instance and restore ExceptT (with #if)
commitea1539b06b52585208bf92a75b1fe61bfdea68fc authormoss <moss@tvisioninsights.com> dateMon 24 Apr 2017, 15:54 (9 years ago) parent16a968d
1 file changed+7−5
src/Data/Swagger/Declare.hs+7−5
src/Data/Swagger/Declare.hs+7−5
@@ -1,3 +1,4 @@
1+{-# LANGUAGE CPP #-}
12{-# LANGUAGE DeriveFunctor #-}
23{-# LANGUAGE FlexibleInstances #-}
34{-# LANGUAGE FunctionalDependencies #-}
@@ -17,7 +18,9 @@ import Prelude.Compat
1718import Control.Monad
1819import Control.Monad.Trans
1920import Control.Monad.Cont (ContT)
20−import Control.Monad.Error (Error, ErrorT)
21+#if __GLASGOW_HASKELL__ >= 710
22+import Control.Monad.Except (ExceptT)
23+#endif
2124import Control.Monad.List (ListT)
2225import Control.Monad.Reader (ReaderT)
2326import Control.Monad.Trans.Identity (IdentityT)
@@ -151,12 +154,11 @@ instance MonadDeclare d m => MonadDeclare d (ContT r m) where
151154 declare = lift . declare
152155 look = lift look
153156
154−-- Note: deprecated, fails with -Wall
155−instance (Error e, MonadDeclare d m) => MonadDeclare d (ErrorT e m) where
157+#if __GLASGOW_HASKELL__ >= 710
158+instance MonadDeclare d m => MonadDeclare d (ExceptT e m) where
156159 declare = lift . declare
157160 look = lift look
158−
159−-- Note: ExceptT not provided because it is not available in ghc 7.8.
161+#endif
160162
161163instance MonadDeclare d m => MonadDeclare d (IdentityT m) where
162164 declare = lift . declare