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

Resolve build warnings #1564

Open
wants to merge 10 commits into
base: master
Choose a base branch
from

Conversation

nbacquey
Copy link
Contributor

@nbacquey nbacquey commented Mar 17, 2022

This PR solves all current compile time warnings in servant, so that mistakes can be more easily spotted when interacting with the code base.

The only nontrivial fix is the one of "erroring instances" of HasLink, HasClient, and HasServer. Those erroring instances, by construction, do not define all methods of their type class, thus generating warnings. It wouldn't have been reasonable to silence all such warnings in their respective files, because those files contain multiple other instance declarations, and having missing methods warnings for those is useful.

Therefore, I chose to move the erroring instances in separate files (thus refactoring a bit the structure of the code base), and silence "missing methods" warning in those new files only.

The PR may be squashed before merging ; I kept it unsquashed so that modifications to renamed files would be more readable.

@nbacquey nbacquey changed the title Resolve build warning Resolve build warnings Mar 17, 2022
@ysangkok
Copy link
Contributor

@nbacquey Have you noticed that doctests are failing?

@nbacquey
Copy link
Contributor Author

@nbacquey Have you noticed that doctests are failing?

Thanks for noticing ; doctests should be fine now

@nbacquey nbacquey force-pushed the resolve-warnings branch 2 times, most recently from 72ea4df to 4ad54b6 Compare November 22, 2022 14:38
The file is small enough that using unticked constructors should not be
error-prone
@nbacquey
Copy link
Contributor Author

@tchoutri @alpmestan
Could I have your position about this PR?

@tchoutri
Copy link
Contributor

tchoutri commented Nov 22, 2022

@nbacquey Hi! After a cursory review, I'd like to ask for a changelog entry, as it is my understanding that you add a new public module Servant.Server.TypeErrors that you have split from Servant.Server.Internal. :)

@nbacquey
Copy link
Contributor Author

@nbacquey Hi! After a cursory review, I'd like to ask for a changelog entry, as it is my understanding that you add a new public module Servant.Server.TypeErrors that you have split from Servant.Server.Internal. :)

Instead of adding a changelog entry, I preferred to declare Servant.Server.TypeErrors in other-modules instead. Its introduction is just a technicality, users should only use Servant.Server directly to benefit from the custom TypeErrors

@tchoutri
Copy link
Contributor

Ah I see indeed. :)

Copy link
Contributor

@tchoutri tchoutri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless something else pops up, approved!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants