Closed nomeata closed 4 years ago
Thanks for pointing this out! That is pseudocode for what's going on, so users could understand more or less what's going on, the docs are not out of date 😊
In the screenshot you can see that it says "a little bit like this" implying it is not the actual one.
The code you linked essentially generates a call to runLambda
, which is where everything is going on.
I don't think that docs are out of date, but still if you feel like they can improved in any way, feel free to open an issue on it, or reopen this one. Thanks again! 😀
I indeed didn't see the “a little bit like this” :-)
Maybe some documentation on runLambda
when one wants to use it directly might be nice. But I understand it if you don't want to support other workflows bedsides the recommended one.
To be honest I wouldn't wish anyone to do that. runLambda
is the interaction point with the AWS Lambda environment, and it receives a function that has to be of some specific form. Adding docs for that would defy the intention of the whole runtime 😬
I'd rather add better TH errors if someone encounters the current ones difficult to understand.
I disagree. The whole runtime does two things:
These seem clearly different tasks to me, and wanting to do 1 doesn’t mean you want 2 as well (Think wai
and wai-routes
).
For example a lambda that has only a single handler doesn’t need 2.
Or am I missing something?
I see what you mean here, in that case it'd be probably better to provide a singleHandler
function or something like that. A user could call that like:
main = singleHandler foo
-- actual handler
foo = ...
On https://theam.github.io/aws-lambda-haskell-runtime/03-configuring-the-dispatcher.html we get a
main
that looks like thisbut this seems very different from what’s generated by https://hackage.haskell.org/package/aws-lambda-haskell-runtime-2.0.3/docs/src/Aws.Lambda.Meta.Main.html#generate. Are the docs out of date?
(I probably shouldn’t mess with such low level things, but I like to understand the tools that I am using, and avoiding TH is part of that.)