amazonka 1.0.0 → 1.0.1
raw patch · 7 files changed
+40/−28 lines, 7 filesdep ~amazonka-coredep ~bytestringdep ~conduitPVP: major bump suggested
API removals or changes: PVP suggests a major version bump
Dependency ranges changed: amazonka-core, bytestring, conduit, conduit-extra, directory, exceptions, free, http-client, http-conduit, ini, lens, mmorph, monad-control, mtl, resourcet, retry, text, time, transformers, transformers-base, transformers-compat
API changes (from Hackage documentation)
- Control.Monad.Trans.AWS: instance MFunctor AWST
- Control.Monad.Trans.AWS: instance Monad m => Applicative (AWST m)
- Control.Monad.Trans.AWS: instance Monad m => Functor (AWST m)
- Control.Monad.Trans.AWS: instance Monad m => Monad (AWST m)
- Control.Monad.Trans.AWS: instance Monad m => MonadFree Command (AWST m)
- Control.Monad.Trans.AWS: instance MonadPlus m => Alternative (AWST m)
+ Control.Monad.Trans.AWS: data Command r
+ Control.Monad.Trans.AWS: hoistAWST :: (Monad m, Monad n) => (forall a. m a -> n a) -> AWST m b -> AWST n b
+ Control.Monad.Trans.AWS: instance Alternative m => Alternative (AWST m)
+ Control.Monad.Trans.AWS: instance Applicative (AWST m)
+ Control.Monad.Trans.AWS: instance Functor (AWST m)
+ Control.Monad.Trans.AWS: instance Monad (AWST m)
+ Control.Monad.Trans.AWS: instance MonadFree Command (AWST m)
+ Network.AWS: data Command r
+ Network.AWS.Data: matchCI :: Text -> a -> Parser a
Files
- amazonka.cabal +7/−9
- src/Control/Monad/Trans/AWS.hs +19/−14
- src/Network/AWS.hs +4/−1
- src/Network/AWS/Data.hs +1/−0
- src/Network/AWS/EC2/Metadata.hs +1/−1
- src/Network/AWS/Free.hs +7/−2
- src/Network/AWS/Presign.hs +1/−1
amazonka.cabal view
@@ -1,5 +1,5 @@ name: amazonka-version: 1.0.0+version: 1.0.1 synopsis: Comprehensive Amazon Web Services SDK homepage: https://github.com/brendanhay/amazonka license: OtherLicense@@ -22,15 +22,13 @@ <http://hackage.haskell.org/package/amazonka-ml/docs/Network-AWS-MachineLearning.html Network.AWS.MachineLearning>) and one of the following: .- * "Control.Monad.Trans.AWS": The 'Control.Monad.Trans.AWS.AWST' transformer- and generalised operations.+ * "Control.Monad.Trans.AWS": The 'AWST' transformer and generalised operations. .- * "Network.AWS": The 'Network.AWS.AWS' monad and 'Network.AWS.MonadAWS' type- class for automatically lifting operations when embedded as a layer in a transformer stack.- This is built upon "Control.Monad.Trans.AWS".+ * "Network.AWS": The 'AWS' monad and 'MonadAWS' type class for automatically+ lifting operations when embedded as a layer in a transformer stack. .- Both 'Control.Monad.Trans.AWS.AWST' (and 'Network.AWS.AWS') and the provided- functions are built upon the 'Control.Monad.Trans.Free' DSL defined in+ Both 'Control.Monad.Trans.AWS.AWST' and 'Network.AWS.AWS' provide functions+ that are built upon a 'MonadFree' 'Command' DSL defined in "Network.AWS.Free". This allows writing a custom interpreter (say, for mocking purposes) and defining your own AWS logic if desired. .@@ -62,7 +60,7 @@ , Network.AWS.Internal.Logger build-depends:- amazonka-core == 1.0.0.*+ amazonka-core == 1.0.1.* , base >= 4.7 && < 5 , bytestring >= 0.9 , conduit >= 1.1
src/Control/Monad/Trans/AWS.hs view
@@ -20,7 +20,7 @@ -- Portability : non-portable (GHC extensions) -- -- The 'AWST' transformer provides the environment required to perform AWS--- operations and constructs a 'Command' AST using 'FreeT' which can then be+-- operations and constructs a 'Command' AST using 'MonadFree' which can then be -- interpreted using 'runAWST'. The transformer is intended to be used directly -- or embedded as a layer within a transformer stack. --@@ -32,6 +32,7 @@ AWST , runAWST , execAWST+ , hoistAWST -- * Authentication and Environment , newEnv@@ -131,6 +132,7 @@ , newLogger -- * Re-exported Types+ , Command , RqBody , RsBody , module Network.AWS.Types@@ -146,12 +148,12 @@ import Control.Monad.Base import Control.Monad.Catch import Control.Monad.Error.Class (MonadError (..))-import Control.Monad.Morph+import Control.Monad.Morph (hoist) import Control.Monad.Reader import Control.Monad.State.Class import Control.Monad.Trans.Control-import Control.Monad.Trans.Free-import qualified Control.Monad.Trans.Free.Church as Free+import Control.Monad.Trans.Free (FreeF (Pure), FreeT (..))+import Control.Monad.Trans.Free.Church import Control.Monad.Trans.Resource import Control.Monad.Writer.Class import Data.IORef@@ -169,7 +171,7 @@ import Network.AWS.Waiter (Wait) -- | The 'AWST' transformer.-newtype AWST m a = AWST { unAWST :: FreeT Command (ReaderT Env m) a }+newtype AWST m a = AWST { unAWST :: FT Command (ReaderT Env m) a } deriving ( Functor , Applicative@@ -190,19 +192,17 @@ instance MonadBase b m => MonadBase b (AWST m) where liftBase = liftBaseDefault -instance MFunctor AWST where- hoist nat = AWST . hoistFreeT (hoist nat) . unAWST- instance MonadBaseControl b m => MonadBaseControl b (AWST m) where type StM (AWST m) a = StM m (FreeF Command a (FreeT Command (ReaderT Env m) a)) - liftBaseWith f = AWST . FreeT . liftM Pure $+ liftBaseWith f = AWST . toFT . FreeT . liftM Pure $ liftBaseWith $ \runInBase -> f $ \k ->- runInBase (runFreeT (unAWST k))+ runInBase $+ runFreeT (fromFT (unAWST k)) - restoreM = AWST . FreeT . restoreM+ restoreM = AWST . toFT . FreeT . restoreM instance MonadTrans AWST where lift = AWST . lift . lift@@ -228,7 +228,7 @@ -- Any outstanding HTTP responses' 'ResumableSource' will -- be closed when the 'ResourceT' computation is unwrapped with 'runResourceT'. ----- Throws 'Error' during interpretation of the underlying 'FreeT' 'Command' AST.+-- Throws 'Error' during interpretation of the underlying 'MonadFree' 'Command' AST. -- -- /See:/ 'runResourceT'. runAWST :: (MonadCatch m, MonadResource m, HasEnv r) => r -> AWST m a -> m a@@ -294,8 +294,13 @@ -> r -> AWST m a -> m a-innerAWST f e (AWST m) =- runReaderT (f `Free.iterT` Free.toFT m) (e ^. environment)+innerAWST f e (AWST m) = runReaderT (f `iterT` m) (e ^. environment)++hoistAWST :: (Monad m, Monad n)+ => (forall a. m a -> n a)+ -> AWST m b+ -> AWST n b+hoistAWST nat = AWST . hoistFT (hoist nat) . unAWST hoistError :: MonadThrow m => Either Error a -> m a hoistError = either (throwingM _Error) return
src/Network/AWS.hs view
@@ -121,6 +121,7 @@ , newLogger -- * Re-exported Types+ , AWST.Command , RqBody , RsBody , module Network.AWS.Types@@ -214,7 +215,9 @@ -- -- /See:/ 'runAWST', 'runResourceT'. runAWS :: (MonadCatch m, MonadResource m, HasEnv r) => r -> AWS a -> m a-runAWS e = liftResourceT . AWST.runAWST e . hoist (withInternalState . const)+runAWS e = liftResourceT+ . AWST.runAWST e+ . AWST.hoistAWST (withInternalState . const) -- | Scope an action within the specific 'Region'. within :: MonadAWS m => Region -> AWS a -> m a
src/Network/AWS/Data.hs view
@@ -18,6 +18,7 @@ -- * Text FromText (..) , fromText+ , matchCI , ToText (..) -- * ByteString
src/Network/AWS/EC2/Metadata.hs view
@@ -22,7 +22,7 @@ -- and are using either the 'Network.AWS.AWS' or 'Control.Monad.Trans.AWS.AWST' -- monads, then prefer one of the 'Control.Monad.Trans.AWS.metadata' related -- functions available there, as the functions in this module do not use the--- underlying 'FreeT' 'Network.AWS.Free.Command' DSL.+-- underlying 'MonadFree' 'Network.AWS.Free.Command' DSL. module Network.AWS.EC2.Metadata ( -- * EC2 Instance Check
src/Network/AWS/Free.hs view
@@ -27,7 +27,6 @@ import Network.AWS.Request (requestURL) import Network.AWS.Types import Network.AWS.Waiter- #if MIN_VERSION_free(4,12,0) #else import Control.Monad.Catch@@ -81,6 +80,12 @@ instance MonadCatch m => MonadCatch (FreeT Command m) where catch (FreeT m) f = FreeT $ liftM (fmap (`catch` f)) m `catch` (runFreeT . f)++instance MonadThrow m => MonadThrow (FT Command m) where+ throwM = lift . throwM++instance MonadCatch m => MonadCatch (FT Command m) where+ catch m f = toFT $ fromFT m `catch` (fromFT . f) #endif -- | Send a request, returning the associated response if successful.@@ -177,7 +182,7 @@ presignWith f ts ex x = liftF (SignF (f (serviceOf x)) ts ex x id) -- | Test whether the underlying host is running on EC2.--- For 'IO' based interpretations of 'FreeT' 'Command', this is memoised and+-- For 'IO' based interpretations of 'MonadFree' 'Command', this is memoised and -- any external check occurs for the first call only. isEC2 :: MonadFree Command m => m Bool isEC2 = liftF (CheckF id)
src/Network/AWS/Presign.hs view
@@ -16,7 +16,7 @@ -- If you wish to presign requests and are using either the 'Network.AWS.AWS' -- or 'Control.Monad.Trans.AWS.AWST' monads, then prefer one of the relevant -- 'Control.Monad.Trans.AWS.presign'ing functions available there, as the--- functions in this module do not use the underlying 'FreeT'+-- functions in this module do not use the underlying 'MonadFree' -- 'Network.AWS.Free.Command' DSL. module Network.AWS.Presign where