HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleservant-server-0.20.2Haskell2010

Servant.Server.Generic

  • 2 types
  • 5 values
datadata AsServerT (m :: Type -> Type)
#

A type that specifies that an API record contains a server implementation.

Instances2GenericMode, :-
valuegenericServeTWithContext
  1. :: (GenericServant routes (AsServerT m), GenericServant routes AsApi, HasServer (ToServantApi routes) ctx, HasContextEntry (ctx .++ DefaultErrorFormatters) ErrorFormatters, ServerT (ToServantApi routes) m ~ ToServant routes (AsServerT m))
  2. => (forall a. m a -> Handler a)

    hoistServer argument to come back to Handler

  3. -> routes (AsServerT m)

    your record full of request handlers

  4. -> Context ctx

    the Context to serve the application with

  5. -> Application
#

Transform a record of routes with custom monad into a WAI Application, while using the given Context to serve the application (contexts are typically used by auth-related combinators in servant, e.g to hold auth checks) and the given transformation to map all the handlers back to the Handler monad.