theam / aws-lambda-haskell-runtime

⚡Haskell runtime for AWS Lambda
https://theam.github.io/aws-lambda-haskell-runtime/
Other
269 stars 48 forks source link

Issue when using UseWithAPIGateway and OverloadedStrings as a default extension #70

Closed dnikolovv closed 4 years ago

dnikolovv commented 4 years ago

If you have OverloadedStrings enabled (e.g. as a default) and attempt to use UseWithAPIGateway, you'll get a similar error.

Ambiguous type variable ‘a0’ arising from a use of ‘aeson-1.4.7.1:Data.Aeson.Types.ToJSON.toJSON’       prevents the constraint ‘(aeson-1.4.7.1:Data.Aeson.Types.ToJSON.ToJSON                                   a0)’ from being solved.

The fix is to just add {-# LANGUAGE NoOverloadedStrings #-} at the top of the file.

This issue can be easily resolved by annotating the strings in the generated code.

NickSeagull commented 4 years ago

I see, what would you suggest in order to fix this, adding something in the docs, changing the generator, ...?

dnikolovv commented 4 years ago

I'll submit a fix shortly (if not today, tomorrow). It's to simply be explicit about the type of the Something went wrong string.