web-routes-quasi-0.6.1.3: Define data types and parse/build functions for web-routes via a quasi-quoted DSL

Web.Routes.Quasi.Parse

Contents

Synopsis

Quasi quoter

parseRoutes :: QuasiQuoterSource

A quasi-quoter to parse a string into a list of Resources. Checks for overlapping routes, failing if present; use parseRoutesNoCheck to skip the checking. See documentation site for details on syntax.

parseRoutesNoCheck :: QuasiQuoterSource

Same as parseRoutes, but performs no overlap checking.

data Resource Source

A single resource pattern.

First argument is the name of the constructor, second is the URL pattern to match, third is how to dispatch.

Constructors

Resource String [Piece] [String] 

data Piece Source

A single piece of a URL, delimited by slashes.

In the case of StaticPiece, the argument is the value of the piece; for the other constructors, it is the name of the parameter represented by this piece. That value is not used here, but may be useful elsewhere.