[web-devel] Type-safe URL handling

Jeremy Shaw jeremy at n-heptane.com
Thu Apr 1 15:13:46 EDT 2010

On Thu, Apr 1, 2010 at 12:19 PM, Michael Snoyman <michael at snoyman.com>wrote:

> Minor update: I think that YAML syntax for these kinds of routes is a
> little bit verbose; any thoughts on this syntax:
> /                    Home       GET
> /user/#userid        User       GET PUT DELETE
> /static              Static     StaticRoutes staticRoutes
> /foo/*slurp          Foo
> /bar/$barparam       Bar
> First column is the pattern, second is the constructor name, and after that
> you have three possibilities:
> Nothing is a handler function for any request method. Above, the fourth and
> fifth entries.
> A list of request methods will allow a handler function for each request
> method. Above, the first and second entries.
> A datatype and function name, allowing a subsite datatype and subsite
> function. Above,the third entry. I'll need to develop this one a bit more.

How would this pattern be translated to the new scheme ?

    GET: media

I am guessing:

/entries/$entryId/$filename    Media    GET

And the Media constructor would be:

   | Media String String


- jeremy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/web-devel/attachments/20100401/e79a9f9f/attachment.html

More information about the web-devel mailing list