
Jeremy Shaw
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")]
vs
[("foo", ["a", "b", "c"])]
The latter has the advantage that "lookup" returns all of the values at once. Would "Map String [String]" be better?
I know that in practice we usually ignore the order of the keys, but in
On Mon, Aug 9, 2010 at 9:56 PM, Gregory Collins