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

Avoid using deprecated head and tail functions #195

Merged
merged 1 commit into from
Sep 18, 2023

Conversation

RyanGlScott
Copy link
Collaborator

@RyanGlScott RyanGlScott commented Sep 1, 2023

GHC 9.8 adds the -Wx-partial warning to -Wall, which is triggered upon any use of the partial head or tail functions from Prelude. This patch rewrites some code in th-desugar to avoid head/tail, and thereby avoid new warnings with GHC 9.8. Sometimes, this can be achieved by some mild refactoring, but in other cases, we simply have to accept the partiality inherent in some code and make the error cases more explicit.

GHC 9.8 adds the `-Wx-partial` warning to `-Wall`, which is triggered upon any
use of the partial `head` or `tail` functions from `Prelude`. This patch
rewrites some code in `th-desugar` to avoid `head`/`tail`, and thereby avoid
new warnings with GHC 9.8. Sometimes, this can be achieved by some mild
refactoring, but in other cases, we simply have to accept the partiality
inherent in some code and make the error cases more explicit.
@RyanGlScott RyanGlScott force-pushed the T182-avoid-partial-warnings branch from f17d913 to 92e8526 Compare September 18, 2023 10:22
@RyanGlScott RyanGlScott marked this pull request as ready for review September 18, 2023 10:31
@RyanGlScott RyanGlScott merged commit 5414beb into master Sep 18, 2023
22 checks passed
@RyanGlScott RyanGlScott deleted the T182-avoid-partial-warnings branch September 18, 2023 10:32
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 this pull request may close these issues.

1 participant