| 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: Sun, 18 Jan 2026 07:12:09 GMT
X-Served-By: cache-dfw-kdfw8210087-DFW, cache-bom-vanm7210023-BOM
X-Cache: MISS, MISS
X-Cache-Hits: 0, 0
X-Timer: S1768720328.449999,VS0,VE747
Vary: Accept, Accept-Encoding
transfer-encoding: chunked
servant-match: Standalone implementation of servant’s dispatching mechanism
[Skip to Readme]
servant-match: Standalone implementation of servant’s dispatching mechanism
This package provides a standalone implementation of dispatching a
function by matching it against a Servant API. A common usecase for
this is to convert an URI to an ADT that provides a more structured
representation of the URL.
[Skip to Readme]
Downloads
- servant-match-0.1.1.tar.gz [browse] (Cabal source package)
- Package description (as included in the package)
Maintainer's Corner
For package maintainers and hackage trustees
Candidates
| Versions [RSS] | 0.1.1 |
|---|---|
| Dependencies | base (>=4.8 && <5), bytestring, http-types, network-uri, servant (>=0.12), text, utf8-string [details] |
| Tested with | ghc ==7.10.3, ghc ==8.0.2, ghc ==8.2.2 |
| License | BSD-3-Clause |
| Copyright | (C) 2017 Moritz Kiefer |
| Author | Moritz Kiefer |
| Maintainer | moritz.kiefer@purelyfunctional.org |
| Uploaded | by cocreature at 2017-12-04T19:26:36Z |
| Category | Web |
| Home page | https://github.com/cocreature/servant-match#readme |
| Source repo | head: git clone https://github.com/cocreature/servant-match |
| Distributions | NixOS:0.1.1 |
| Reverse Dependencies | 1 direct, 0 indirect [details] |
| Downloads | 1038 total (5 in the last 30 days) |
| Rating | (no votes yet) [estimated by Bayesian average] |
| Your Rating |
|
| Status | Docs available [build log] Last success reported on 2017-12-04 [all 1 reports] |
Readme for servant-match-0.1.1
[back to package description]servant-match
This package provides a standalone implementation of dispatching a
function by matching it against a Servant API. A common usecase for
this is to convert an URI to an ADT that provides a more structured
representation of the URL.
Usage
data DataView
= Show
| Edit
deriving (Show, Eq)
data View
= ViewUsers
| ViewNewUser
| ViewUser !Text !DataView
deriving (Show, Eq)
data User = User
type API =
"users" :> (Get '[JSON] [User] :<|> "new" :> ReqBody '[JSON] User :> Post '[JSON] User) :<|>
"user" :> Capture "user" Text :>
(Get '[JSON] User :<|>
"edit" :> ReqBody '[JSON] User :> Put '[JSON] User)
parser :: MatchT API View
parser =
(ViewUsers :<|> ViewNewUser) :<|> (\u -> ViewUser u Show :<|> ViewUser u Edit)