aws-easy-0.1.0.0: AWS Easy: Helper functions for working with amazonka

Copyright(C) Richard Cook 2018
LicenseMIT
Maintainerrcook@rcook.org
Stabilityexperimental
Portabilityportable
Safe HaskellNone
LanguageHaskell2010

Network.AWS.Easy.TH

Description

This modules provides Template Haskell helper functions for eliminating boilerplate

Synopsis

Documentation

wrapAWSService Source #

Arguments

:: Name

Name of the amazonka Service value to wrap

-> String

Name of the service type to generate

-> String

Name of the session type to generate

-> Q [Dec]

Declarations for splicing into source file

Generates type-safe AWS service and session wrappers types for use with connect and withAWS functions

Example top-level invocation:

wrapAWSService 'dynamoDB "DDBService" "DDBSession"

This will generate boilerplate like the following:

data DDBService = DDBService Service

data DDBSession = DDBSession Session

instance ServiceClass DDBService where
    type TypedSession DDBService = DDBSession
    rawService (DDBService x) = x
    wrappedSession = DDBSession

instance SessionClass DDBSession where
    rawSession (DDBSession x) = x

dynamoDBService :: DDBService
dynamoDBService = DDBService dynamoDB