snap-core-0.9.5.0/ 0000755 0000000 0000000 00000000000 12236240457 011745 5 ustar 00 0000000 0000000 snap-core-0.9.5.0/README.SNAP.md 0000644 0000000 0000000 00000002273 12236240457 013770 0 ustar 00 0000000 0000000 Snap Framework
--------------
Snap is a simple and fast web development framework and server written in
Haskell. For more information or to download the latest version, you can visit
the Snap project website at http://snapframework.com/.
Snap Status and Features
------------------------
The Snap core system consists of:
* a high-speed HTTP server, with an optional high-concurrency backend using
the [libev](http://software.schmorp.de/pkg/libev.html) library
* a sensible and clean monad for web programming
* an xml-based templating system for generating HTML that allows you to bind
Haskell functionality to XML tags without getting PHP-style tag soup all
over your pants
* a "snaplet" system for building web sites from composable pieces.
Snap is currently only officially supported on Unix platforms; it has been
tested on Linux and Mac OSX Snow Leopard, and is reported to work on Windows.
Snap Philosophy
---------------
Snap aims to be the *de facto* web toolkit for Haskell, on the basis of:
* High performance
* High design standards
* Simplicity and ease of use, even for Haskell beginners
* Excellent documentation
* Robustness and high test coverage
snap-core-0.9.5.0/Setup.hs 0000644 0000000 0000000 00000000057 12236240457 013403 0 ustar 00 0000000 0000000 import Distribution.Simple
main = defaultMain
snap-core-0.9.5.0/LICENSE 0000644 0000000 0000000 00000003006 12236240457 012751 0 ustar 00 0000000 0000000 Copyright (c) 2009, Snap Framework authors (see CONTRIBUTORS)
Copyright (c) 2010, Google, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above copyright notice, this
list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
Neither the name of the Snap Framework authors nor the names of its
contributors may be used to endorse or promote products derived from this
software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
snap-core-0.9.5.0/snap-core.cabal 0000644 0000000 0000000 00000013414 12236240457 014623 0 ustar 00 0000000 0000000 name: snap-core
version: 0.9.5.0
synopsis: Snap: A Haskell Web Framework (core interfaces and types)
description:
Snap is a simple and fast web development framework and server written in
Haskell. For more information or to download the latest version, you can
visit the Snap project website at .
.
This library contains the core definitions and types for the Snap framework,
including:
.
1. Primitive types and functions for HTTP (requests, responses, cookies,
post/query parameters, etc)
.
2. Type aliases and helper functions for Iteratee I/O
.
3. A monad for programming web handlers called \"Snap\", 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
.
/Quick start/: The 'Snap' monad and HTTP definitions are in "Snap.Core",
some iteratee utilities are in "Snap.Iteratee".
license: BSD3
license-file: LICENSE
author: James Sanders, Shu-yu Guo, Gregory Collins, Doug Beardsley
maintainer: snap@snapframework.com
build-type: Simple
cabal-version: >= 1.8
homepage: http://snapframework.com/
category: Web, Snap
extra-source-files:
test/suite/TestSuite.hs,
cbits/timefuncs.c,
CONTRIBUTORS,
extra/haddock.css,
extra/hscolour.css,
extra/logo.gif,
haddock.sh,
LICENSE,
README.md,
README.SNAP.md,
Setup.hs,
test/data/fileServe/foo.bin,
test/data/fileServe/foo.bin.bin.bin,
test/data/fileServe/foo.html,
test/data/fileServe/foo.txt,
test/data/fileServe/mydir1/index.txt,
test/data/fileServe/mydir2/foo.txt,
test/data/fileServe/mydir3/altindex.html,
test/runTestsAndCoverage.sh,
test/snap-core-testsuite.cabal,
test/suite/Snap/Core/Tests.hs,
test/suite/Snap/Internal/Http/Types/Tests.hs,
test/suite/Snap/Internal/Parsing/Tests.hs,
test/suite/Snap/Internal/Routing/Tests.hs,
test/suite/Snap/Iteratee/Tests.hs,
test/suite/Snap/Test/Common.hs,
test/suite/Snap/Util/FileServe/Tests.hs,
test/suite/Snap/Util/FileUploads/Tests.hs,
test/suite/Snap/Util/GZip/Tests.hs,
test/suite/Snap/Util/Proxy/Tests.hs
Flag portable
Description: Compile in cross-platform mode. No platform-specific code or
optimizations such as C routines will be used.
Default: False
Flag debug
Description: Enable debug logging code. With this flag, Snap will
test the DEBUG environment variable to decide whether to do
logging, and this introduces a tiny amount of overhead
(a call into a function pointer) because the calls to 'debug'
cannot be inlined.
Default: False
Library
hs-source-dirs: src
if !flag(debug)
cpp-options: -DNODEBUG
if flag(portable) || os(windows)
cpp-options: -DPORTABLE
build-depends: old-locale >= 1 && <2
else
c-sources: cbits/timefuncs.c
include-dirs: cbits
build-depends: bytestring-mmap >= 0.2.2 && <0.3,
unix >= 2.4 && <3.0
cpp-options: -DUSE_UNIX
exposed-modules:
Snap.Core,
Snap.Types,
Snap.Iteratee,
Snap.Internal.Debug,
Snap.Internal.Exceptions,
Snap.Internal.Http.Types,
Snap.Internal.Iteratee.Debug,
Snap.Internal.Parsing,
Snap.Test,
Snap.Types.Headers,
Snap.Util.FileServe,
Snap.Util.FileUploads,
Snap.Util.GZip,
Snap.Util.Proxy,
Snap.Util.Readable
other-modules:
Snap.Internal.Instances,
Snap.Internal.Iteratee.BoyerMooreHorspool,
Snap.Internal.Parsing.FastSet,
Snap.Internal.Routing,
Snap.Internal.Types,
Snap.Internal.Test.RequestBuilder,
Snap.Internal.Test.Assertions
build-depends:
attoparsec >= 0.10 && < 0.11,
attoparsec-enumerator >= 0.3 && < 0.4,
base >= 4 && < 5,
blaze-builder >= 0.2.1.4 && < 0.4,
blaze-builder-enumerator >= 0.2 && < 0.3,
bytestring >= 0.9 && < 0.11,
case-insensitive >= 0.3 && < 1.2,
containers >= 0.3 && < 1.0,
deepseq >= 1.1 && < 1.4,
directory >= 1 && < 2,
enumerator >= 0.4.15 && < 0.5,
filepath >= 1.1 && < 2.0,
hashable (>= 1.1 && < 1.2) || (>= 1.2.1 && <1.3),
HUnit >= 1.2 && < 2,
MonadCatchIO-transformers >= 0.2.1 && < 0.4,
mtl >= 2.0 && < 2.2,
random >= 1 && < 2,
regex-posix >= 0.95 && < 1,
text >= 0.11 && < 0.12,
time >= 1.0 && < 1.5,
unix-compat >= 0.2 && < 0.5,
unordered-containers >= 0.1.4.3 && < 0.3,
vector >= 0.6 && < 0.11,
zlib-enum >= 0.2.1 && < 0.3
extensions:
BangPatterns,
CPP,
DeriveDataTypeable,
EmptyDataDecls,
ExistentialQuantification,
FlexibleContexts,
FlexibleInstances,
ForeignFunctionInterface,
GeneralizedNewtypeDeriving,
MultiParamTypeClasses,
OverloadedStrings,
OverloadedStrings,
PackageImports,
Rank2Types,
ScopedTypeVariables,
TypeSynonymInstances
ghc-prof-options: -prof -auto-all
if impl(ghc >= 6.12.0)
ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
-fno-warn-unused-do-bind
else
ghc-options: -Wall -fwarn-tabs -funbox-strict-fields -O2
source-repository head
type: git
location: git://github.com/snapframework/snap-core.git
snap-core-0.9.5.0/README.md 0000644 0000000 0000000 00000003775 12236240457 013240 0 ustar 00 0000000 0000000 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`.
snap-core-0.9.5.0/CONTRIBUTORS 0000644 0000000 0000000 00000000627 12236240457 013632 0 ustar 00 0000000 0000000 Doug Beardsley
Gregory Collins
Shu-yu Guo
Carl Howells
Shane O'Brien
James Sanders
Jacob Stanley
Jonas Kramer
Jurriën Stutterheim
Jasper Van der Jeugt
Bryan O'Sullivan
snap-core-0.9.5.0/haddock.sh 0000755 0000000 0000000 00000000446 12236240457 013705 0 ustar 00 0000000 0000000 #!/bin/sh
set -x
rm -Rf dist/doc
HADDOCK_OPTS='--html-location=http://hackage.haskell.org/packages/archive/$pkg/latest/doc/html'
cabal haddock $HADDOCK_OPTS --hyperlink-source $@
cp extra/logo.gif dist/doc/html/snap-core/haskell_icon.gif
cp extra/hscolour.css dist/doc/html/snap-core/src/
snap-core-0.9.5.0/extra/ 0000755 0000000 0000000 00000000000 12236240457 013070 5 ustar 00 0000000 0000000 snap-core-0.9.5.0/extra/hscolour.css 0000644 0000000 0000000 00000000737 12236240457 015447 0 ustar 00 0000000 0000000 body { font-size: 90%; }
pre, code, body {
font-family: Monaco,
"DejaVu Sans Mono",
"Bitstream Vera Sans Mono",
"Lucida Console",
monospace;
}
.hs-keyglyph, .hs-layout {color: #5200A3;}
.hs-keyword {color: #3465a4; font-weight: bold;}
.hs-comment, .hs-comment a {color: #579; }
.hs-str, .hs-chr {color: #141B24;}
.hs-keyword, .hs-conid, .hs-varid, .hs-conop, .hs-varop, .hs-num, .hs-cpp, .hs-sel, .hs-definition {}
snap-core-0.9.5.0/extra/logo.gif 0000644 0000000 0000000 00000001137 12236240457 014521 0 ustar 00 0000000 0000000 GIF89a ` J"K#M%N(P1W1X3Z6\?d4e=i9i:j