Last active
July 2, 2019 07:27
-
-
Save sevanspowell/ee6a2508d409a89e28cb493f7a8a4785 to your computer and use it in GitHub Desktop.
WrappingFail
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
data WrapperError = WrappingS3Error Jaws.S3Error | |
makeClassyPrisms ''WrapperError | |
instance Jaws.AsS3Error WrapperError where | |
_S3Error = _WrappingS3Error | |
data Lookup m a = Lookup (m a) | |
inner | |
:: ( AWS.MonadAWS m | |
, MonadError e m | |
, Jaws.AsS3Error e | |
, MonadResource m | |
) | |
=> Lookup m a | |
-> m S3.GetObjectResponse | |
inner _ = Jaws.getObjectResponse "bucket" "key" | |
wrapper | |
:: ( AWS.MonadAWS m | |
, MonadError e m | |
, AsWrapperError e | |
, MonadResource m | |
) | |
=> Lookup m a | |
-> m S3.GetObjectResponse | |
wrapper lookup = do | |
(e :: Either WrapperError S3.GetObjectResponse) <- runExceptT $ inner lookup | |
either (throwing _WrappingError) pure e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
error:
• Occurs check: cannot construct the infinite type:
m ~ ExceptT S3Error m
Expected type: ExceptT S3Error m S3.GetObjectResponse
Actual type: m S3.GetObjectResponse