Spock · Tutorials

Spock API reference

These package versions are built together from the Spock repository. Links between them stay within this reference; available dependency documentation links to Hackage.

PackageVersionModules
reroute0.9.0.1All modules
Spock-core0.16.1.0All modules
Spock0.18.0.0All modules
Spock-api0.17.0.0All modules
Spock-api-server0.17.0.0All modules
Spock-session-postgresql0.1.0.3All modules
Spock-session-cookie0.1.0.0All modules
Spock-api-ghcjs0.15.0.1All modules
Spock-browser0.1.0.0All modules

Haskell in the browser

Spock-api-ghcjs 0.15.0.1 pairs with Spock-api 0.17.0.0. The client reference is generated from GHC JavaScript 9.12.2 interfaces; the native libraries use GHC 9.14.1. Start with callEndpoint and browserClient, or follow the shared browser/server tutorial.

For typed client-side navigation, see route and mountRouter.

Handling requests and responses

Web.Spock reexports the Web.Spock.Action module from Spock-core. Start there for request parsing and response helpers.

Typed path captures are arguments to your route handler. Set status and headers before sending a response; response helpers finish the action.

Source repository · Generated with Cabal and Haddock.