The whole tutorial is a cabal project and can be built locally as follows:

$ git clone
$ cd servant
# build
$ cabal new-build tutorial
# load in ghci to play with it
$ cabal new-repl tutorial


The servant stack template includes the working tutorial. To initialize this template, run:

$ stack new myproj servant
$ cd myproj
# build
$ stack build
# start server
$ stack exec myproj-exe

The code can be found in the *.lhs files under doc/tutorial/ in the repository. Feel free to edit it while you’re reading this documentation and see the effect of your changes.


Nix users should feel free to take a look at the nix/shell.nix file in the repository and use it to provision a suitable environment to build and run the examples.