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

singletons-{th,base}: Require building with GHC 9.8 #575

Merged
merged 5 commits into from
Oct 12, 2023
Merged

Conversation

RyanGlScott
Copy link
Collaborator

This:

  • Supports invisible binders in type-level declarations.
  • Supports the FldName namespace introduced in GHC 9.8.
  • Tweaks some code to avoid -Wx-partial warnings introduced in GHC 9.8.

See also #564.

This consists of two parts:

1. Several uses of `TyVarBndrUnit` in type-level declarations had to be changed
   to `TyVarBndrVis` to reflect that these places can now accept both required
   and invisible `@`-binders.
2. The logic for generating a standalone kind signature for a singled `data`
   declaration (see `Data.Singletons.TH.Single.Data.singDataSAK`) had to be
   updated to account for invisible `@`-binders. Thanks to previous work, this
   is a fairly straightforward process.

I have added a `Singletons.TypeAbstractions` test case to kick the tires and
ensure that everything works as expected.
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 `singletons` 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.

In addition, `-Worphans` now checks for orphan type _family_ instances in GHC
9.8 in addition to orphan type _class_ instances. The `singletons` test suite
defines some orphan type family instances, so we disable this warning there.
@RyanGlScott RyanGlScott merged commit 6334b1b into master Oct 12, 2023
24 checks passed
@RyanGlScott RyanGlScott deleted the ghc-9.8 branch October 12, 2023 10:22
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