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

Ability to place Throws/Throwing before multiple grouped route definitions #6

Closed
lexi-lambda opened this issue May 3, 2017 · 0 comments · Fixed by #7
Closed

Ability to place Throws/Throwing before multiple grouped route definitions #6

lexi-lambda opened this issue May 3, 2017 · 0 comments · Fixed by #7

Comments

@lexi-lambda
Copy link
Contributor

Currently, this doesn’t work:

data API = Throws MyErr :> "foo" :> Get '[JSON] ()

Specifically, the relevant HasServer instance does not exist, so this is probably related to #4. This would be very useful, since it would allow doing something like this:

data API = Throws MyErr :> ("foo" :> Get '[JSON] () :<|> "bar" :> Get '[JSON] ())

…which helps to reduce boilerplate when a group of APIs all produce the same errors.

lexi-lambda added a commit to lexi-lambda/servant-checked-exceptions that referenced this issue May 3, 2017
These instances cover uses of (:<|>) as well as sequential uses of (:>).
The latter instance uses a helper type family to avoid overlapping with
the instance for Throwing followed by Throws.

closes cdepillabout#6
lexi-lambda added a commit to lexi-lambda/servant-checked-exceptions that referenced this issue May 3, 2017
lexi-lambda added a commit to lexi-lambda/servant-checked-exceptions that referenced this issue May 3, 2017
cdepillabout referenced this issue May 4, 2017
Add additional HasServer and HasClient instances for Throwing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant