@hackage amazonka-mtl0.1.1.3
MTL-style type-class and deriving-via newtypes for Amazonka
Categories
License
MIT
Maintainer
Freckle Education
Links
Versions
Installation
Dependencies (9)
- amazonka >=2.0
- amazonka-core >=2.0
- base >=4.14.3.0 && <5
- conduit >=1.3.4.2
- lens >=4.19.2
- monad-logger >=0.3.36 Show all…
Dependents (1)
@hackage/stackctl
amazonka-mtl
MTL-style type-class and deriving-via newtypes for Amazonka.
Example
This package allows incorporation of AWS actions into any MTL-style function,
import Amazonka.Data.Text (ToText(..))
import Amazonka.S3.ListObjects
import Amazonka.S3.Types.Object
import Blammo.Logging
import Conduit
import Control.Lens hiding ((.=))
import Control.Monad.AWS as AWS
someAction
:: ( MonadIO m
, MonadLogger m
, MonadAWS m
, MonadReader env m
, HasSettings env
)
=> m ()
someAction = do
Settings {..} <- view settingsL
keys <-
runConduit
$ paginate (newListObjects settingsBucketName)
.| concatMapC (^. listObjectsResponse_contents)
.| concatC
.| mapC (^. object_key . to toText)
.| iterMC (\k -> logDebug $ k :# [])
.| sinkList
logInfo $ "Bucket contents" :# ["keys" .= keys]
This package also provides a number of options for execution:
- Through a concrete transformer:
Control.Monad.AWS.EnvT - Through your own reader env and deriving-via:
Control.Monad.AWS.ViaReader
This package also provides mechanisms for mocking AWS in tests:
- Through a concrete transformer:
Control.Monad.AWS.MockT - Through your own reader env and deriving-via:
Control.Monad.AWS.ViaMock
Please see the documentation on hackage for all the details.
Development & Tests
stack build --fast --pedantic --test --file-watch
Release
To trigger a release, merge a commit to main that follows Conventional
Commits. In short,
fix:to trigger a patch release,feat:for minor, and<type>!:or add aBREAKING CHANGE:footer to trigger major
We don't enforce conventional commits generally (though you are free do so), it's only required if you want to trigger release.