Skip to content

Commit 6fafaec

Browse files
committed
Change Semigroup (ClientM a) to Alt ClientM
1 parent fdf86b0 commit 6fafaec

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

servant-client/servant-client.cabal

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ library
5252
, monad-control >= 1.0.0.4 && < 1.1
5353
, network-uri >= 2.6 && < 2.7
5454
, safe >= 0.3.9 && < 0.4
55+
, semigroupoids >= 4.3 && < 5.2
5556
, servant == 0.9.*
5657
, string-conversions >= 0.3 && < 0.5
5758
, text >= 1.2 && < 1.3

servant-client/src/Servant/Common/Req.hs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ import Control.Exception
1616
import Control.Monad
1717
import Control.Monad.Catch (MonadThrow, MonadCatch)
1818
import Data.Foldable (toList)
19-
import Data.Semigroup (Semigroup (..))
19+
import Data.Functor.Alt (Alt (..))
20+
import Data.Semigroup ((<>))
2021

2122
import Control.Monad.Error.Class (MonadError(..))
2223
import Control.Monad.Trans.Except
@@ -216,8 +217,8 @@ instance MonadBaseControl IO ClientM where
216217
restoreM st = ClientM (restoreM st)
217218

218219
-- | Try clients in order, last error is preserved.
219-
instance Semigroup (ClientM a) where
220-
a <> b = a `catchError` \_ -> b
220+
instance Alt ClientM where
221+
a <!> b = a `catchError` \_ -> b
221222

222223
runClientM :: ClientM a -> ClientEnv -> IO (Either ServantError a)
223224
runClientM cm env = runExceptT $ (flip runReaderT env) $ runClientM' cm

0 commit comments

Comments
 (0)