镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

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

Open

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!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions