Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve Params #69

Open
bergmark opened this issue Sep 22, 2014 · 1 comment · May be fixed by #156
Open

Improve Params #69

bergmark opened this issue Sep 22, 2014 · 1 comment · May be fixed by #156

Comments

@bergmark
Copy link
Member

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.

@hesselink
Copy link
Member

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.

@theNerd247 theNerd247 linked a pull request Nov 3, 2017 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants