theam / aws-lambda-haskell-runtime

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

`Servant` & `beam`: ``gcc' failed in phase `Linker'` #51

Open Jimbo4350 opened 4 years ago

Jimbo4350 commented 4 years ago

Check out the branches persistent and beam: https://github.com/Jimbo4350/serverless-servant-faulty

If you remove comment out: fromServant <- makeHandler (serve itemApi server) event & ++ ByteString.unpack fromServant in src/Lib.hs the package will compile. Otherwise it fails with a linking error.

handler :: Event -> Context -> IO (Either String Response)
handler event context = do
  fromServant <- makeHandler (serve itemApi server) event
  pure $ Right Response
    { statusCode = 200
    , body = "test: " ++ ByteString.unpack fromServant
    }