Add Alpha
and Subst
instances for NonEmpty
#62
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
NonEmpty
has been inbase
since version 4.9, so accepting this PR probably requires changing the lower bound onbase
in the.cabal
file as well as removing GHC 7.8 and 7.10 from thetested-with
list, OR including theNonEmpty
instances conditionally, via CPP. I'm not sure what your policy is on support for older versions ofbase
/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 useNonEmpty
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 aNonEmpty
list since every definition must have at least one clause. After making the refactoring, I ran into the lack ofAlpha
andSubst
instances. I put in some derived orphan instances for the moment but figured it would be nice to send these upstream.