| CARVIEW |
Select Language
HTTP/1.1 200 OK
Connection: keep-alive
Server: nginx/1.24.0 (Ubuntu)
Content-Type: text/html; charset=utf-8
Cache-Control: public, max-age=300
Content-Encoding: gzip
Via: 1.1 varnish, 1.1 varnish
Accept-Ranges: bytes
Age: 0
Date: Sat, 17 Jan 2026 22:13:46 GMT
X-Served-By: cache-dfw-ktki8620048-DFW, cache-bom-vanm7210024-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768688026.878793,VS0,VE370
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
snap-predicates: Declarative routing for Snap.
[Skip to Readme]
snap-predicates: Declarative routing for Snap.
Provides the definition of a predicate type-class together with several concrete implementations which are used to constrain the set of possible Snap handlers in a type-safe way.
[Skip to Readme]
Modules
[Index]
Downloads
- snap-predicates-0.3.1.tar.gz [browse] (Cabal source package)
- Package description (revised from the package)
Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
- No Candidates
| Versions [RSS] | 0.1.0, 0.2.0, 0.3.0, 0.3.1 |
|---|---|
| Dependencies | attoparsec (>=0.10), base (>=4 && <5), bytestring (>=0.9), case-insensitive (>=1.0), containers (>=0.5), monads-tf (>=0.1), snap-core (>=0.9), text (>=0.11), transformers (>=0.3) [details] |
| License | LicenseRef-OtherLicense |
| Copyright | Copyright (c) 2013 Toralf Wittner, Brendan Hay |
| Author | Toralf Wittner, Brendan Hay |
| Maintainer | Toralf Wittner <tw@dtex.org> |
| Uploaded | by ToralfWittner at 2013-07-02T18:57:51Z |
| Revised | Revision 1 made by ToralfWittner at 2016-01-24T13:03:29Z |
| Category | Snap |
| Source repo | head: git clone git@gitlab.com:twittner/snap-predicates.git |
| Distributions | |
| Reverse Dependencies | 1 direct, 0 indirect [details] |
| Downloads | 3201 total (17 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs uploaded by user Build status unknown [no reports yet] |
Readme for snap-predicates-0.3.1
[back to package description]Snap-Predicates
This library provides the definition of a type-class Predicate
together with several concrete implementations which are used to
constrain the set of possible Snap handlers in a type-safe
way.
A module Snap.Predicates.Tutorial is included, outlining the basic concepts.
Example Usage
main :: IO ()
main = do
mapM_ putStrLn (showRoutes sitemap)
quickHttpServe (route . expandRoutes $ sitemap)
sitemap :: Routes Snap ()
sitemap = do
head_ "/status" (const $ return ())
get "/foo" listFoo $
Accept Text Plain :&: ParamDef "off" 0 :&: ParamDef "size" 100
post "/foo" createFoo $
Accept Text Plain :&: ContentType Application Protobuf
listFoo :: MediaType Text Plain :*: Int :*: Int -> Snap ()
listFoo (_mt :*: _off :*: _size) = return ()
createFoo :: MediaType Text Plain :*: Content Application Protobuf -> Snap ()
createFoo (_mt :*: _ct) = return ()