[web-devel] Re: Proposed changes to web-routes: query-string support

Gregory Collins greg at gregorycollins.net
Mon Aug 9 14:56:21 EDT 2010

Jeremy Shaw <jeremy at n-heptane.com> writes:

> Nice!
> I have not had time to look at this in detail, and probably won't for a few
> more days. But I am certainly in favor of the concept.
> I recently wrote some code for one of my own projects to deal with creating
> query string key/value pairs. It will be interesting to see  how they overlap.
> - jeremy
> p.s. Also, the query string is not required to be key/value pairs. It can be
> any non-hierarchical data which, combined with the path info,  serves to
> identify a resource. It just happens the key/value pairs are  the single most
> common what of encoding the this data. If web-routes  is going to only support
> key/value pairs, that is fine. But we should  probably acknowledge that in the
> docs.

Should the type of the query string part should be "[(String,[String])]"
instead of "[(String, String)]"? I guess it depends on whether you
wanted "/?foo=a&foo=b&foo=c" to decode the query params as:

    [("foo","a"), ("foo","b"), ("foo","c")]


    [("foo", ["a", "b", "c"])]

The latter has the advantage that "lookup" returns all of the values at
once. Would "Map String [String]" be better?

Gregory Collins <greg at gregorycollins.net>

More information about the web-devel mailing list