Skip to content

This example in the documentation does not seem to typecheck #131

@adithyaov

Description

@adithyaov
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!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions