Renamed AtLeastOneFragment type class to AtMostOneFragment#1727
Merged
tchoutri merged 4 commits intohaskell-servant:masterfrom Mar 16, 2024
Merged
Renamed AtLeastOneFragment type class to AtMostOneFragment#1727tchoutri merged 4 commits intohaskell-servant:masterfrom
AtLeastOneFragment type class to AtMostOneFragment#1727tchoutri merged 4 commits intohaskell-servant:masterfrom
Conversation
AtLeastOneFragment to AtMostOneFragmentAtLeastOneFragment type class to AtMostOneFragment
Contributor
|
@jkarni would you mind giving your opinion on this? |
Contributor
|
@DavidMazarro Thanks for the PR! |
Contributor
Author
|
(I added these last two commits because I was unfamiliar with |
Contributor
Author
|
Feel free to run the CI on this one again, but other than that it's ready to merge from my side :) |
Contributor
Author
|
@tchoutri could you run the CI workflow again? |
Contributor
|
Alright, I have looked up the usage of Thanks @DavidMazarro! |
netbsd-srcmastr
pushed a commit
to NetBSD/pkgsrc
that referenced
this pull request
Jan 30, 2025
---- - Full query string helpers [#1604](haskell-servant/servant#1604) This PR introduces `DeepQuery`, a route combinator that implements a pattern commonly known as deep objects. It builds upon the convention of using `[]` for a list of parameters: `books?filter[search]=value&filter[author][name]=value`. The corresponding type would be `DeepQuery "filter" BookQuery :> Get '[JSON] [Book]`. - Add IsIn instance for NamedRoutes [#1707](haskell-servant/servant#1707) - Renamed `AtLeastOneFragment` type class to `AtMostOneFragment` [#1727](haskell-servant/servant#1727) The previously named `AtLeastOneFragment` type class defined in the `Servant.API.TypeLevel` module has been renamed to `AtMostOneFragment`, since the previous name was misleading. - Use `Header'` in response headers. [#1697](haskell-servant/servant#1697) Use `Header'` instead of `Header` in response, so it's possible to provide `Description`, for example: ``` type PaginationTotalCountHeader = Header' '[ Description "Indicates to the client total count of items in collection" , Optional , Strict ] "Total-Count" Int ``` Note: if you want to add header with description you should use `addHeader'` or `noHeader'` which accepts `Header'` with all modifiers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Unless I'm misunderstanding the
FragmentUniquetype family, it's checking that there's at most one fragment in the API type. In that case, theAtLeastOneFragmentname is not only confusing, but potentially misleading. This PR renames the type class toAtMostOneFragment.In addition, I did some small changes to the documentation, I moved the explanation of the type class to the type class definition (previously the comment was under the
Verbinstance) and reworded it a bit.