haskell-servant / servant

Main repository for the servant libraries — DSL for describing, serving, querying, mocking, documenting web applications and more!
https://docs.servant.dev/
1.8k stars 407 forks source link

Renamed `AtLeastOneFragment` type class to `AtMostOneFragment` #1727

Closed DavidMazarro closed 3 months ago

DavidMazarro commented 4 months ago

Unless I'm misunderstanding the FragmentUnique type family, it's checking that there's at most one fragment in the API type. In that case, the AtLeastOneFragment name is not only confusing, but potentially misleading. This PR renames the type class to AtMostOneFragment.

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 Verb instance) and reworded it a bit.

tchoutri commented 4 months ago

@jkarni would you mind giving your opinion on this?

tchoutri commented 4 months ago

@DavidMazarro Thanks for the PR!

DavidMazarro commented 4 months ago

(I added these last two commits because I was unfamiliar with doctest and didn't know the code examples were checked, my bad!)

DavidMazarro commented 4 months ago

Feel free to run the CI on this one again, but other than that it's ready to merge from my side :)

DavidMazarro commented 3 months ago

@tchoutri could you run the CI workflow again?

tchoutri commented 3 months ago

Alright, I have looked up the usage of AtLeastOneFragment across openn-source codebases on github and hackage, looks like we can get away with this breaking change.

Thanks @DavidMazarro!