File: README.md

package info (click to toggle)
haskell-snap-core 0.8.1-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 576 kB
  • sloc: haskell: 6,767; sh: 55; ansic: 22; makefile: 2
file content (70 lines) | stat: -rw-r--r-- 2,045 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
Snap Framework Core
===================

Snap is a web framework for Haskell, based on iteratee I/O (as [popularized by
Oleg Kiselyov](http://okmij.org/ftp/Streams.html#iteratee)).  For more
information about Snap, read the `README.SNAP.md` or visit the Snap project
website at http://www.snapframework.com/.

## Library contents

This is the `snap-core` library, which contains:

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

  * type aliases and helper functions for Iteratee I/O.

  * a "Snap" monad interface, inspired by
    [happstack's](http://happstack.com/index.html), 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.

  * Some useful utilities for web handlers, including gzip/zlib compression.


Building snap-core
===================

The snap-core library is built using [Cabal](http://www.haskell.org/cabal/) and
[Hackage](http://hackage.haskell.org/packages/hackage.html). Just run

    cabal install

from the `snap-core` toplevel directory.


## Building the Haddock Documentation

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

    ./haddock.sh

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


## Building the testsuite

Snap is still in its very early stages, so most of the "action" (and a big
chunk of the code) right now is centred on the test suite. Snap aims for 100%
test coverage, and we're trying hard to stick to that.

To build the test suite, `cd` into the `test/` directory and run

    $ cabal configure
    $ cabal build

From here you can invoke the testsuite by running:

    $ ./runTestsAndCoverage.sh 


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