Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 4973b2457b
Fetching contributors…

Cannot retrieve contributors at this time

63 lines (58 sloc) 2.503 kb
name: route-generator
version: 0.3.1
cabal-version: >= 1.8
license: OtherLicense
license-file: COPYING
category: Utility
copyright: © 2012 Stephen Paul Weber
author: Stephen Paul Weber <singpolyma@singpolyma.net>
maintainer: Stephen Paul Weber <singpolyma@singpolyma.net>
stability: experimental
tested-with: GHC == 7.0.3
synopsis: Utility to generate routes for use with yesod-routes
homepage: http://github.com/singpolyma/route-generator
bug-reports: http://github.com/singpolyma/route-generator/issues
build-type: Simple
description:
Most of the defacto Haskell web routing libraries are either linear
in complexity, or require lots of extra extensions, like Template
Haskell.
.
Luckily, yesod-routes has Yesod.Routes.Dispatch, which is a very clean,
efficient, and extension-free router. Writing routes out in code can,
however, be quite verbose. This utility is a code generator to produce
routes compatible with Yesod.Routes.Dispatch from a nice input format.
.
Example:
.
> GET / => home
> GET /post/: => showPost
> PUT /* => updateSomething
.
> ./routeGenerator -r -m SomeModule routes.txt
.
Will generate routes that map the correct HTTP verb (which you should
pass as a prepended "path segment" to your Dispatch) and path to
functions imported from the module specified in the second parameter.
.
A colon matches any path segment, and passes the matched segment
through to the specified function, passing each match segment in order.
The expected type of the segment is inferred from the type of the
function. If the segment cannot be parsed as that type, the path does
not match. Parsing is done with Web.PathPieces.fromPathPiece.
.
An asterisk at the end of the path causes rhHasMulti to be set to True,
meaning that any path segments after what has been specified will be
allowed.
extra-source-files:
README
executable routeGenerator
main-is: routeGenerator.hs
build-depends:
base == 4.*,
text >= 0.7,
attoparsec >= 0.10.0.0,
yesod-routes
source-repository head
type: git
location: git://github.com/singpolyma/route-generator.git
Jump to Line
Something went wrong with that request. Please try again.