-
-
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
Add Foldable#[max|min]ByOption, Reducible#[maxBy|minBy] #2385
Comments
Can I take this? |
@leusgalvan go right ahead! |
@LukaJCB sorry for the delay. Would love to know a little bit more about how bin compatibility is managed in Cats, is there any source you can point me to? In particular I'd like to know the relationship between the *Syntax, *Ops and *Compat classes. From what I've read in the contributing guide I can use mimaReportBinaryIssues to detect the issues. Thanks in advance! |
The *Ops classes are classes that add direct syntax to certain type classes. With that said, I actually think you can drop them right here in this You could look at this PR for inspiration: #2366 :) |
I've had more time to work on this and I'm almost finished adding the implementations to Reducible, Foldable and UnorderedFoldable. I added the [max/min]ByOption to both Foldable and UnorderedFoldable through syntax. I provided the overriden implementation in Foldable because there I can use reduceLeftOption not available in UnorderedFoldable. However, for cases where a type is both Foldable and UnorderedFoldable (e.g. List) the [max/min]ByOption methods are ambigous (they can be reached through either of the conversions). What is the best way to handle this? I don't like the solutions I can think of: remove the implementation from Foldable or rename the methods in Unfoldable with unordered[max/min]ByOption. |
@leusgalvan I found myself needing this very often. I mean one can just pass an |
No description provided.
The text was updated successfully, but these errors were encountered: