Deprecate unlawful Alternative instances for ZipLazyList and ZipStream#4843
Closed
LSUDOKO wants to merge 3 commits intotypelevel:mainfrom
Closed
Deprecate unlawful Alternative instances for ZipLazyList and ZipStream#4843LSUDOKO wants to merge 3 commits intotypelevel:mainfrom
LSUDOKO wants to merge 3 commits intotypelevel:mainfrom
Conversation
Member
|
@LSUDOKO in typelevel/gsoc-onboarding#47, you agreed to follow the Typelevel GSoC AI Policy.
Per our policy, we will not review low-quality and/or AI-generated PRs. It is disrespectful of our time and effort. Thus, I will close your PR at this time. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #4840
Changes
Deprecated
Alternative[ZipLazyList]andAlternative[ZipStream]CommutativeApplicativeinsteadAdded
CommutativeApplicativeas the primary implicitZipLazyListnow providescatsDataCommutativeApplicativeForZipLazyListas the non-deprecated instanceZipStreamnow providescatsDataCommutativeApplicativeForZipStreamas the non-deprecated instanceZipVectorwhich only hasCommutativeApplyUpdated tests
CommutativeApplicativeinstanceBackground
The
Alternativeinstance forZipLazyListandZipStreamwas found to be unlawful.The
combineKmethod used concatenation semantics from the underlyingLazyList/Stream,which is inconsistent with the zipping behavior of
ap. This violates the Alternativeright distributivity law:
This also affects
OneAnd[ZipLazyList, *]which cannot have a lawfulApplicativeinstance when the underlying
Fhas an unlawfulAlternative.