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

This example in the documentation does not seem to typecheck

Open adithyaov opened this issue 3 months ago • 0 comments

import Aws.Lambda

main :: IO ()
main =
  runLambdaHaskellRuntime
    defaultDispatcherOptions
    (pure ())
    id $ do
      addAPIGatewayHandler "api-gateway" gatewayHandler
      addALBHandler "alb" albHandler
      addStandaloneLambdaHandler "standalone" regularHandler

gatewayHandler ::
  ApiGatewayRequest request ->
  Context context ->
  IO (Either (ApiGatewayResponse error) (ApiGatewayResponse response))
gatewayHandler = doSomething

albHandler ::
  ALBRequest request ->
  Context context ->
  IO (Either (ALBResponse error) (ALBResponse response))
albHandler = doSomething

regularHandler ::
  request ->
  Context context ->
  IO (Either error response)
regularHandler = doSomething
addAPIGatewayHandler :: ... -> HandlersM 'APIGatewayHandlerType m context request response error ()
addALBHandler :: ... -> HandlersM 'ALBHandlerType m context request response error ()
addStandaloneLambdaHandler :: ... -> HandlersM 'StandaloneHandlerType m context request response error () 
runLambdaHaskellRuntime :: ... -> HandlersM handlerType m context request response error () -> IO ()

The monad is constrained to handlerType.


A follow-up question:

Is this library maintained? Can I use it in production?

Thanks in advance!

adithyaov avatar Sep 18 '25 18:09 adithyaov