aws-lambda-haskell-runtime icon indicating copy to clipboard operation
aws-lambda-haskell-runtime copied to clipboard

add custom handlers support?

Open stevemao opened this issue 2 years ago • 1 comments

APIGatewayHandler and ALBHandler are very handy handlers. I'm wondering if we could write more custom handlers using the low level StandaloneLambdaHandler?

Had a quick look at the source code it seems impossible right now. These three handlers are constructers of Handler type. Perhaps Handler should be a typeclass.

stevemao avatar Mar 13 '22 12:03 stevemao

Thanks for reporting this!

Now that you mention it, maybe it could be done through ReaderT handler (IO a)? I think it could be positive to use it in a concrete way like that, instead of relying on a type class which could result in more confusing errors for newcomers

NickSeagull avatar Mar 14 '22 11:03 NickSeagull