nixpkgs/pkgs/development/haskell-modules/patches/amazonka-new-monad-control.patch
Shea Levy 6e008f05ab haskellng: Get amazonka family building
amazonka-0.0.7 is broken, so I also updated hackage-packages after
applying NixOS/cabal2nix#119.
2015-01-09 19:03:27 -05:00

62 lines
2.1 KiB
Diff

From 3a91e0114214083d3f84375152a35d4247bb7a81 Mon Sep 17 00:00:00 2001
From: Shea Levy <shea@shealevy.com>
Date: Fri, 9 Jan 2015 18:54:59 -0500
Subject: [PATCH] amazonka: Build against monad-control >=1
---
amazonka/amazonka.cabal | 2 +-
amazonka/src/Control/Monad/Trans/AWS.hs | 15 +++++++--------
2 files changed, 8 insertions(+), 9 deletions(-)
diff --git a/amazonka.cabal b/amazonka.cabal
index 455b7b2..48c5f1c 100644
--- a/amazonka.cabal
+++ b/amazonka.cabal
@@ -49,7 +49,7 @@ library
, http-conduit >= 2.1.4 && < 2.3
, lens >= 4.4 && < 5
, mmorph >= 1 && < 2
- , monad-control >= 0.3.2 && < 1
+ , monad-control >= 1
, mtl >= 2.2.1 && < 2.3
, resourcet >= 1.1 && < 1.3
, retry >= 0.5
diff --git a/src/Control/Monad/Trans/AWS.hs b/src/Control/Monad/Trans/AWS.hs
index bc13925..75f2a4d 100644
--- a/src/Control/Monad/Trans/AWS.hs
+++ b/src/Control/Monad/Trans/AWS.hs
@@ -172,26 +172,25 @@ instance MonadBase b m => MonadBase b (AWST m) where
{-# INLINE liftBase #-}
instance MonadTransControl AWST where
- newtype StT AWST a = StTAWS
- { unStTAWS :: StT (ExceptT Error) (StT (ReaderT (Env, InternalState)) a)
- }
+ type StT AWST a =
+ StT (ExceptT Error) (StT (ReaderT (Env, InternalState)) a)
liftWith f = AWST $
liftWith $ \g ->
liftWith $ \h ->
- f (liftM StTAWS . h . g . unAWST)
+ f (h . g . unAWST)
{-# INLINE liftWith #-}
- restoreT = AWST . restoreT . restoreT . liftM unStTAWS
+ restoreT = AWST . restoreT . restoreT
{-# INLINE restoreT #-}
instance MonadBaseControl b m => MonadBaseControl b (AWST m) where
- newtype StM (AWST m) a = StMAWST { unStMAWST :: ComposeSt AWST m a }
+ type StM (AWST m) a = ComposeSt AWST m a
- liftBaseWith = defaultLiftBaseWith StMAWST
+ liftBaseWith = defaultLiftBaseWith
{-# INLINE liftBaseWith #-}
- restoreM = defaultRestoreM unStMAWST
+ restoreM = defaultRestoreM
{-# INLINE restoreM #-}
instance MFunctor AWST where