You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I just briefly talked about this with @sebastiaanvisser and we had an idea that looks promising. We'd have a two layer approach, where you write something like:
mCount <- get "count"
mOffset <- get "offset"return (Range<$> mCount <*> mOffset)
The get method would be in a type class, where the instance for e.g. Int would write some info saying "the key 'count' is an Int" and return a parser for an Int from the Maybe String.
If it works, this would allow for better documentation, and a more convenient way of writing these parsers.
Currently you have to define two separate functions for working with params, parsing and pretty printing of query strings.
It's pretty awkward to work with these, the interface should be absracted.
It'd also be nicer to use a type class like with the other dictionaries to automatically pick the right implementation.
The text was updated successfully, but these errors were encountered: