instanceSetConv :: (MonadThrow m, Applicative m)
    => XmlElement -> m [Instance]
instanceSetConv = itemsSet "instancesSet" conv
  where
    placementConv e = Placement
        <$> e .< "availabilityZone"
        <*> e .< "groupName"
        <*> e .< "tenancy"
    profileConv e = IamInstanceProfile
        <$> e .< "arn"
        <*> e .< "id"
    conv e = Instance
        <$> e .< "instanceId"
        <*> e .< "imageId"
        <*> instanceStateConv "instanceState" e
        <*> e .< "privateDnsName"
        <*> e .< "dnsName"
        <*> e .< "reason"
        <*> e .< "keyName"
        <*> e .< "amiLaunchIndex"
        <*> productCodeConv e
        <*> e .< "instanceType"
        <*> e .< "launchTime"
        <*> element "placement" placementConv e
        <*> e .< "kernelId"
        <*> e .< "ramdiskId"
        <*> e .< "platform"
        <*> element "monitoring" (.< "state") e
        <*> e .< "subnetId"
        <*> e .< "vpcId"
        <*> e .< "privateIpAddress"
        <*> e .< "ipAddress"
        <*> e .< "sourceDestCheck"
        <*> groupSetConv e
        <*> stateReasonConv e
        <*> e .< "architecture"
        <*> e .< "rootDeviceType"
        <*> e .< "rootDeviceName"
        <*> instanceBlockDeviceMappingsConv e
        <*> e .< "instanceLifecycle"
        <*> e .< "spotInstanceRequestId"
        <*> e .< "virtualizationType"
        <*> e .< "clientToken"
        <*> resourceTagConv e
        <*> e .< "hypervisor"
        <*> networkInterfaceConv e
        <*> elementM "iamInstanceProfile" profileConv e
        <*> e .< "ebsOptimized"
instanceSetConv :: (MonadThrow m, Applicative m)
    => XmlElement -> m [Instance]
instanceSetConv = itemsSet "instancesSet" conv
  where
    placementConv e = Placement
        <$> e .< "availabilityZone"
        <*> e .< "groupName"
        <*> e .< "tenancy"
    profileConv e = IamInstanceProfile
        <$> e .< "arn"
        <*> e .< "id"
    conv e = Instance
        <$> e .< "instanceId"
        <*> e .< "imageId"
        <*> instanceStateConv "instanceState" e
        <*> e .< "privateDnsName"
        <*> e .< "dnsName"
        <*> e .< "reason"
        <*> e .< "keyName"
        <*> e .< "amiLaunchIndex"
        <*> productCodeConv e
        <*> e .< "instanceType"
        <*> e .< "launchTime"
        <*> element "placement" placementConv e
        <*> e .< "kernelId"
        <*> e .< "ramdiskId"
        <*> e .< "platform"
        <*> element "monitoring" (.< "state") e
        <*> e .< "subnetId"
        <*> e .< "vpcId"
        <*> e .< "privateIpAddress"
        <*> e .< "ipAddress"
        <*> e .< "sourceDestCheck"
        <*> groupSetConv e
        <*> stateReasonConv e
        <*> e .< "architecture"
        <*> e .< "rootDeviceType"
        <*> e .< "rootDeviceName"
        <*> instanceBlockDeviceMappingsConv e
        <*> e .< "instanceLifecycle"
        <*> e .< "spotInstanceRequestId"
        <*> e .< "virtualizationType"
        <*> e .< "clientToken"
        <*> resourceTagConv e
        <*> e .< "hypervisor"
        <*> networkInterfaceConv e
        <*> elementM "iamInstanceProfile" profileConv e
        <*> e .< "ebsOptimized"
instanceSetConv = itemsSet "instancesSet" conv
  where
    placementConv e = Placement
        <$> e .< "availabilityZone"
        <*> e .< "groupName"
        <*> e .< "tenancy"
    profileConv e = IamInstanceProfile
        <$> e .< "arn"
        <*> e .< "id"
    conv e = Instance
        <$> e .< "instanceId"
        <*> e .< "imageId"
        <*> instanceStateConv "instanceState" e
        <*> e .< "privateDnsName"
        <*> e .< "dnsName"
        <*> e .< "reason"
        <*> e .< "keyName"
        <*> e .< "amiLaunchIndex"
        <*> productCodeConv e
        <*> e .< "instanceType"
        <*> e .< "launchTime"
        <*> element "placement" placementConv e
        <*> e .< "kernelId"
        <*> e .< "ramdiskId"
        <*> e .< "platform"
        <*> element "monitoring" (.< "state") e
        <*> e .< "subnetId"
        <*> e .< "vpcId"
        <*> e .< "privateIpAddress"
        <*> e .< "ipAddress"
        <*> e .< "sourceDestCheck"
        <*> groupSetConv e
        <*> stateReasonConv e
        <*> e .< "architecture"
        <*> e .< "rootDeviceType"
        <*> e .< "rootDeviceName"
        <*> instanceBlockDeviceMappingsConv e
        <*> e .< "instanceLifecycle"
        <*> e .< "spotInstanceRequestId"
        <*> e .< "virtualizationType"
        <*> e .< "clientToken"
        <*> resourceTagConv e
        <*> e .< "hypervisor"
        <*> networkInterfaceConv e
        <*> elementM "iamInstanceProfile" profileConv e
        <*> e .< "ebsOptimized"