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

Deprecation of Semigroup and Monoid #2935

Merged
merged 37 commits into from
Mar 10, 2023
Merged

Deprecation of Semigroup and Monoid #2935

merged 37 commits into from
Mar 10, 2023

Conversation

serras
Copy link
Member

@serras serras commented Feb 17, 2023

  • Const the whole type is being deprecated
  • Ior
  • Iterable
  • NonEmptyList
  • Option
  • Pair
  • Sequence
  • map
  • predef
  • Validated the whole type is being deprecated
  • continuations/*` the whole thing is being deprecated
  • raise/RaiseAccumulate
  • raise/Builders
  • fx/ParTraverseValidated the whole file is being deprecated

@github-actions
Copy link
Contributor

github-actions bot commented Feb 17, 2023

Kover Report

File Coverage [55.54%]
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Const.kt 0.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Either.kt 57.86%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Endo.kt 75.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Ior.kt 59.22%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Iterable.kt 84.74%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/NonEmptyList.kt 67.29%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Option.kt 53.02%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Pair.kt 0.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Sequence.kt 61.59%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/Validated.kt 50.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/map.kt 66.29%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/predef.kt 100.00%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Builders.kt 97.92%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/core/raise/Raise.kt 77.50%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/typeclasses/Monoid.kt 17.81%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/typeclasses/Semigroup.kt 12.50%
arrow-libs/core/arrow-core/src/commonMain/kotlin/arrow/typeclasses/Semiring.kt 0.00%
arrow-libs/optics/arrow-optics/src/commonMain/kotlin/arrow/optics/Every.kt 6.11%
Total Project Coverage 43.16%

@serras serras self-assigned this Feb 17, 2023
@nomisRev nomisRev added the 1.2.0 Tickets belonging to 1.1.2 label Feb 18, 2023
@serras serras marked this pull request as ready for review February 23, 2023 09:43
@serras serras requested review from nomisRev and a team February 23, 2023 09:43
Copy link
Member

@nomisRev nomisRev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you so much @serras for taking on this work! 🙏 🙌
A couple of remarks, and suggestions. Mostly about two things:

  1. I think we missed a bunch of mapOrAccumulate implementation where now new methods for Validated have been introduced. Since mapOrAccumulate is defined over Raise<E>.(A) -> B it's compatible with both Validated and Either after users refactor away from Validated.

  2. A couple of APIs I think we should deprecate all together with the removal of Semigroup rather than introduce new methods that were previously derived from Monad + Semigroup/Monoid or Applicative + Semigroup/Monoid.

@serras
Copy link
Member Author

serras commented Mar 3, 2023

There's one missing point for this PR, which is what should be done with the tests using MonoidLaws and SemigroupLaws. I have no good answer, the best I can think of is moving Monoid and Semigroup to test once 1.2.0 is out.

@nomisRev
Copy link
Member

nomisRev commented Mar 3, 2023

MonoidLaws and SemigroupLaws.

Does it still make sense if we remove the typeclass? Otherwise I would say follow the same pattern as we do here. Replace with (E, E) -> E and (E, (E, E) -> E) and deprecate old ones.

That way you can still test String::plus and "", String::plus if you want to.

@nomisRev
Copy link
Member

nomisRev commented Mar 7, 2023

@serras I updated the PR, I think my changes need a thorough reverse review from you 😅

@serras serras requested a review from nomisRev March 8, 2023 15:03
Copy link
Member

@nomisRev nomisRev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great. Awesome work @serras 🙏 👏 🙌

Copy link
Collaborator

@gutiory gutiory left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
I've just left a thought, but it's just a thought related to replacements to depreacation methods. Feel free to use it or not 😄 .

@nomisRev nomisRev merged commit 1fd8cca into main Mar 10, 2023
@nomisRev nomisRev deleted the deprecate-semigroup-monoid branch March 10, 2023 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.2.0 Tickets belonging to 1.1.2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants