An open API service providing package, version and dependency metadata of many open source software ecosystems and registries.

route-generator

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: 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.

Ecosystem
hackage.haskell.org
Latest Release
0.6.1
over 12 years ago
Versions
8
Downloads
5,919 total
Links
Registry hackage.haskell.org
Source Repository
Homepage Homepage
JSON API View JSON
CodeMeta codemeta.json
Package Details
PURL pkg:hackage/route-generator
spec
License Other
First Release over 13 years ago
Last Synced 24 days ago
Repository
Stars 4 on GitHub
Forks 1 on GitHub