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

Modulesnap-server-1.1.2.1Haskell2010

Snap.Internal.Http.Server.Types

Types internal to the implementation of the Snap HTTP server.

  • 12 types
datadata ServerConfig hookState
#

Data and services that all HTTP response handlers share.

Constructors

datadata PerSessionData
#

All of the things a session needs to service a single HTTP request.

Constructors

typetype ExceptionHook hookState = IORef hookState -> SomeException -> IO ()
#

The ExceptionHook is called if an exception reaches the toplevel of the server, i.e. if an exception leaks out of the user handler or if an exception is raised during the sending of the HTTP response data.

typetype ParseHook hookState = IORef hookState -> Request -> IO ()
#

The ParseHook is called after the HTTP Request has been parsed by the server, but before the user handler starts running.

typetype NewRequestHook hookState = PerSessionData -> IO hookState
#

The NewRequestHook is called once processing for an HTTP request begins, i.e. after the connection has been accepted and we know that there's data available to read from the socket. The IORef passed to the hook initially contains a bottom value that will throw an exception if evaluated.

Handlers

3 declarations

Socket types

1 declaration