@hackage web-inv-route0.1.3.3
Composable, reversible, efficient web routing using invertible invariants and bijections
Categories
License
BSD-3-Clause
Maintainer
dylan@dylex.net
Links
Versions
Installation
Dependencies (14)
- base >=4.9 && <5
- bytestring >=0.10
- case-insensitive
- containers >=0.5
- happstack-server >=7
- hashable Show all…
Dependents (1)
@hackage/acme-everything
Package Flags
uri
(on by default)
Support constructing URIs from routes
wai
(on by default)
Provide WAI-compatible interfaces
snap
(on by default)
Provide Snap-compatible interfaces
happstack
(on by default)
Provide Happstack-compatible interfaces
Utilities to route HTTP requests, mainly focused on path components. Routes are specified using bijections and invariant functors, allowing run-time composition (routes can be distributed across modules), reverse and forward routing derived from the same specification, and O(log n) lookups.
There are four steps/components of this package.
Route endpoint specification:
Web.Route.Invertible.CommonRoute map construction:
Web.Route.Invertible.CommonRoute map lookup:
Web.Route.Invertible(for the generic interface),Web.Route.Invertible.Wai,Web.Route.Invertible.Snap, orWeb.Route.Invertible.HappstackReverse routing:
Web.Route.InvertibleorWeb.Route.Invertible.URI
Most users will just want to import a framework-specific module like Web.Route.Invertible.Wai (or the generic Web.Route.Invertible), each of which re-exports Web.Route.Invertible.Common.
See test/Main.hs for some examples.