-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
SemigroupK/MonoidK methods #4084
Merged
Merged
Changes from all commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
0e0f0d4
Add methods from seimgroup/monoid to semigroupk/monoidk
TimWSpence 9ea68b4
Update scaladoc
TimWSpence 9f348f7
More scaladoc
TimWSpence b0b1404
Remove duplicate tests
TimWSpence 72fe714
Fix 2.12 build
TimWSpence 9fb1bd1
Fix docs
TimWSpence e6fa448
Actually fix docs :facepalm:
TimWSpence c4a620e
Port semigroup/monoid laws to semigroupk/monoidk
TimWSpence 0d7de79
Cleanup comments
TimWSpence 9264e7c
Optimize combineAllK for Option
TimWSpence 5242b6c
DRY
TimWSpence 93de0b8
Override combineAllK for list
TimWSpence c2d3d4f
Override combineAllK for Seq
TimWSpence 7099f59
Override combineAllK for vector
TimWSpence 9c07dde
Override combineAllK for Queue
TimWSpence 47232bf
(Hopefully) fix version-specific errors for IterableOnce
TimWSpence 4322e8b
Fix error message
TimWSpence 05763b2
Only require optimizing combineAllOptionK and not combineAllOption as…
TimWSpence c237e17
Avoid creating closure in comineAllOptionK for Option
TimWSpence 2e5367a
Optimize combineAllOptionK for sequence types
TimWSpence bcc07d8
Eliminate unnecessary iterator allocation
TimWSpence e350e70
Add Alternative#fromIterableOnce and Alternative#fromFoldable
TimWSpence fee0625
Argh scalafmt
TimWSpence 6b5f7fa
Law for Alterantive#fromIterableOnce plus optimized implementations
TimWSpence b531693
Argh scala 2.12 - why do you do this to me? :(
TimWSpence f5bdeca
Use method not deprecated in 2.12
TimWSpence 7a0cd81
More efficient LazyList combineAllOptionK which preserves laziness
TimWSpence 361b6c8
Make Alternative#fromFoldable final
TimWSpence 12053e1
Remove unnecessary Arbitrary instance and fix 2.12 issues
TimWSpence a02f41e
Remove unncessary and binary incompatible added implicit param
TimWSpence 19b3338
I really don't think there is a cyclic dependency dotty...
TimWSpence 549a9f0
Avoid unnecessary allocation
TimWSpence a744378
Optimize fromIterableOnce for Chain
TimWSpence File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I may have suggested making this final, but on second thought I think it should not be.
It could be that F is very efficient to build from a foldRight or a foldLeft or a foldMap. Since we should assume that the foldable for G knows the most efficient way to do those, the
F
implementation here may want to call one of those rather than converting to anIterable[A]
and going from there.This is probably minor, and maybe never a big deal, but the
final
will block this (I may have suggested or previously agreed with final, if so, apologies for the flip-flop).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh yeah, that's a good point.
FTR this was my suggestion in #4084 (comment).
The problem is we can't currently check this implementation in the laws; see #4084 (comment).
So there's a bit of performance vs yolo factor here 😉
We can always take away a
final
modifier, but we can't add it back. So I'd be fine to leave this until a practical need to change this comes up.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why can't we check the laws? why can't we check that
fromFoldable(g) == fromIterable(g.toIterable)
in the laws?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah AFAICT we would have to add extra type parameters to
AlternativeTests#alternative
to do this. Unless I've missed something?