alpmestan / servant

Moved to http://github.com/haskell-servant
50 stars 1 forks source link

Handle lists as query string parameters #19

Closed alpmestan closed 10 years ago

alpmestan commented 10 years ago

Currently, we only have a primitive support for query string parameters.

We'd like to be able to say that we expect a query string list named foo so that if we receive foo[]=1&foo[]=2 we would extract it as a haskell value of type [Int], under Capture "foo" [Int].

Not sure if we want a new class for that or if some modification of FromText can put us on the right track.

alpmestan commented 10 years ago

For the record, we're discussing the introduction of a QueryParams type to handle this specific list behavior, instead of shoe-horning FromText or another class into the right shape to support it through QueryParam alone.

We also suggested a QueryFlag type to handle params that are supposed to be found in the query string withut any value, like foo in: ?bar=1&foo.