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

Add Alpha and Subst instances for NonEmpty #62

Merged
merged 3 commits into from
Mar 20, 2024
Merged

Conversation

byorgey
Copy link
Contributor

@byorgey byorgey commented Mar 20, 2024

NonEmpty has been in base since version 4.9, so accepting this PR probably requires changing the lower bound on base in the .cabal file as well as removing GHC 7.8 and 7.10 from the tested-with list, OR including the NonEmpty instances conditionally, via CPP. I'm not sure what your policy is on support for older versions of base/GHC so I'll leave that up to you!

Especially with the additional warnings generated by GHC 9.8 for the use of partial functions like head, it is nice to be able to use NonEmpty when we statically know a list cannot be empty. For example, I was refactoring some code where I have a function definition that contains a list of clauses --- but in fact it should really be a NonEmpty list since every definition must have at least one clause. After making the refactoring, I ran into the lack of Alpha and Subst instances. I put in some derived orphan instances for the moment but figured it would be nice to send these upstream.

@lambdageek
Copy link
Owner

@byorgey We turned off CI for GHC 7.x last year, so tested-with is an oversight. Base bump should be fine, too.

@lambdageek lambdageek merged commit b7e5bf9 into lambdageek:main Mar 20, 2024
10 checks passed
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.

2 participants