Skip to content
Core type definitions (Snap monad, HTTP types, etc) and utilities for web handlers.
Haskell CSS Other
Latest commit b5ca1f0 @gregorycollins gregorycollins Merge branch '0.9-stable'
Failed to load latest commit information.
extra Twiddle file-upload docs
.gitignore bumped package upper bounds
.stylish-haskell.yaml Minimize imports for snap-core.
CONTRIBUTORS Copypasta FastSet from the attoparsec source (bos just made it private)
LICENSE Google asserts copyright, even on work I do in my own time.
Setup.hs Add Setup.hs
TODO Change content-length and enumerator lengths from Int to Int64 add changelog Remove extra css Remove mentions of iteratees
snap-core.cabal Bump the dependency on 'vector'.

Snap Framework Core

Snap is a web framework for Haskell. For more information about Snap, read the or visit the Snap project website at

Library contents

This is the snap-core library, which contains:

  • primitive types and functions for HTTP (requests, responses, cookies, post/query parameters, etc).

  • a "Snap" monad interface for programming web handlers, which allows:

    • stateful access to the HTTP request and response objects.

    • monadic failure (i.e. MonadPlus/Alternative instances) for declining to handle requests and chaining handlers together.

    • early termination of the computation if you know early what you want to return and want to prevent further monadic processing.

  • useful utilities for web handlers, like file serving and gzip/zlib compression.

Building snap-core

The snap-core library is built using Cabal and Hackage. Just run

cabal install

from the snap-core toplevel directory.

Building the Haddock Documentation

The haddock documentation can be built using the supplied shell script:


The docs get put in dist/doc/html/.

Building the testsuite

Snap aims for 100% test coverage, and we're trying hard to stick to that.

To build the test suite, configure with --enable-tests:

$ cabal configure --enable-tests
$ cabal build

From here you can invoke the testsuite by running:

$ ./

The testsuite generates an hpc test coverage report in dist/hpc.

Something went wrong with that request. Please try again.