The route-generator package

[Tags: program]

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.


 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.


Versions0.1, 0.2, 0.3, 0.3.1, 0.4, 0.5, 0.6, 0.6.1
Change logNone available
Dependenciesattoparsec (>=, base (==4.*), network, text (>=0.7), yesod-routes
Copyright© 2012 Stephen Paul Weber
AuthorStephen Paul Weber <>
MaintainerStephen Paul Weber <>
Home page
Bug tracker
Source repositoryhead: git clone git://
UploadedSat Sep 28 02:36:23 UTC 2013 by StephenWeber
Downloads1031 total (47 in last 30 days)
StatusDocs available [build log]
Successful builds reported [all 1 reports]


Maintainers' corner

For package maintainers and hackage trustees