-
Notifications
You must be signed in to change notification settings - Fork 448
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
Inline NonEmpty
maps
#3120
Inline NonEmpty
maps
#3120
Conversation
Kover Report
|
Do we need to do the same for |
As you mentioned in the ticket, this was probably the best solution in hindsight :/ |
There you are |
@@ -183,9 +183,18 @@ public class NonEmptyList<out A>( | |||
public override inline fun <B> map(transform: (A) -> B): NonEmptyList<B> = | |||
NonEmptyList(transform(head), tail.map(transform)) | |||
|
|||
override fun <B> flatMap(transform: (A) -> NonEmptyCollection<B>): NonEmptyList<B> = | |||
@Suppress("OVERRIDE_BY_INLINE") |
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.
Are these suppressions safe to ignore?
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.
thanks @serras !
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.
Thank you @serras!
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.arrow-kt:arrow-optics-ksp-plugin](https://togithub.com/arrow-kt/arrow) | `1.2.0` -> `1.2.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-optics](https://togithub.com/arrow-kt/arrow) | `1.2.0` -> `1.2.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-optics/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-optics/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-optics/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-optics/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-core](https://togithub.com/arrow-kt/arrow) | `1.2.0` -> `1.2.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-core/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-core/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-core/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-core/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>arrow-kt/arrow (io.arrow-kt:arrow-optics-ksp-plugin)</summary> ### [`v1.2.1`](https://togithub.com/arrow-kt/arrow/releases/tag/1.2.1) [Compare Source](https://togithub.com/arrow-kt/arrow/compare/1.2.0...1.2.1) #### What's Changed - Fix Option.tap deprecation message. by [@​wolpl](https://togithub.com/wolpl) in [https://github.com/arrow-kt/arrow/pull/3096](https://togithub.com/arrow-kt/arrow/pull/3096) - Fix problem with optics and <\*> generics by [@​serras](https://togithub.com/serras) in [https://github.com/arrow-kt/arrow/pull/3097](https://togithub.com/arrow-kt/arrow/pull/3097) - Backport fix for K2 by [@​serras](https://togithub.com/serras) in [https://github.com/arrow-kt/arrow/pull/3098](https://togithub.com/arrow-kt/arrow/pull/3098) - ignoreErrors for Raise by [@​serras](https://togithub.com/serras) in [https://github.com/arrow-kt/arrow/pull/3100](https://togithub.com/arrow-kt/arrow/pull/3100) - Update all dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3085](https://togithub.com/arrow-kt/arrow/pull/3085) - Update all dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3101](https://togithub.com/arrow-kt/arrow/pull/3101) - Update all dependencies to v0.12.0-rc.5 by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3102](https://togithub.com/arrow-kt/arrow/pull/3102) - Update all dependencies to v1.9.0-1.0.12 by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3103](https://togithub.com/arrow-kt/arrow/pull/3103) - Update all dependencies to v5.10.0 by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3104](https://togithub.com/arrow-kt/arrow/pull/3104) - Remove references to shift in Either.kt by [@​nomisRev](https://togithub.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3105](https://togithub.com/arrow-kt/arrow/pull/3105) - Update all dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3106](https://togithub.com/arrow-kt/arrow/pull/3106) - Update dependency org.jetbrains.kotlinx.kover to v0.7.3 by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3107](https://togithub.com/arrow-kt/arrow/pull/3107) - Update all dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3112](https://togithub.com/arrow-kt/arrow/pull/3112) - `parMapNotNull` by [@​raulraja](https://togithub.com/raulraja) in [https://github.com/arrow-kt/arrow/pull/3110](https://togithub.com/arrow-kt/arrow/pull/3110) - `parMapNotNullUnordered` for `Flow` by [@​serras](https://togithub.com/serras) in [https://github.com/arrow-kt/arrow/pull/3111](https://togithub.com/arrow-kt/arrow/pull/3111) - Enable experimental K2 by [@​serras](https://togithub.com/serras) in [https://github.com/arrow-kt/arrow/pull/3087](https://togithub.com/arrow-kt/arrow/pull/3087) - Update all dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3118](https://togithub.com/arrow-kt/arrow/pull/3118) - Update dependency com.diffplug.spotless to v6.21.0 by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3119](https://togithub.com/arrow-kt/arrow/pull/3119) - Inline `NonEmpty` maps by [@​serras](https://togithub.com/serras) in [https://github.com/arrow-kt/arrow/pull/3120](https://togithub.com/arrow-kt/arrow/pull/3120) - Remove enableCompatibilityMetadataVariant by [@​nomisRev](https://togithub.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3124](https://togithub.com/arrow-kt/arrow/pull/3124) - Update actions/checkout action to v4 by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3125](https://togithub.com/arrow-kt/arrow/pull/3125) - Update all dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3121](https://togithub.com/arrow-kt/arrow/pull/3121) #### New Contributors - [@​wolpl](https://togithub.com/wolpl) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3096](https://togithub.com/arrow-kt/arrow/pull/3096) **Full Changelog**: arrow-kt/arrow@1.2.0...1.2.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Enabled. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/sindrenm/android-project-template). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44My4wIiwidXBkYXRlZEluVmVyIjoiMzYuODMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==-->
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [io.arrow-kt:arrow-optics-reflect](https://togithub.com/arrow-kt/arrow) | `1.2.0` -> `1.2.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-optics-reflect/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-optics-reflect/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-optics-reflect/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-optics-reflect/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-optics-ksp-plugin](https://togithub.com/arrow-kt/arrow) | `1.2.0` -> `1.2.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-optics-ksp-plugin/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-optics](https://togithub.com/arrow-kt/arrow) | `1.2.0` -> `1.2.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-optics/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-optics/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-optics/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-optics/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-fx-stm](https://togithub.com/arrow-kt/arrow) | `1.2.0` -> `1.2.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-fx-stm/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-fx-stm/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-fx-stm/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-fx-stm/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-resilience](https://togithub.com/arrow-kt/arrow) | `1.2.0` -> `1.2.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-resilience/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-resilience/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-resilience/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-resilience/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-fx-coroutines](https://togithub.com/arrow-kt/arrow) | `1.2.0` -> `1.2.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-fx-coroutines/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-fx-coroutines/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-fx-coroutines/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-fx-coroutines/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | | [io.arrow-kt:arrow-core](https://togithub.com/arrow-kt/arrow) | `1.2.0` -> `1.2.1` | [![age](https://developer.mend.io/api/mc/badges/age/maven/io.arrow-kt:arrow-core/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/maven/io.arrow-kt:arrow-core/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/maven/io.arrow-kt:arrow-core/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/maven/io.arrow-kt:arrow-core/1.2.0/1.2.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>arrow-kt/arrow (io.arrow-kt:arrow-optics-reflect)</summary> ### [`v1.2.1`](https://togithub.com/arrow-kt/arrow/releases/tag/1.2.1) [Compare Source](https://togithub.com/arrow-kt/arrow/compare/1.2.0...1.2.1) #### What's Changed - Fix Option.tap deprecation message. by [@​wolpl](https://togithub.com/wolpl) in [https://github.com/arrow-kt/arrow/pull/3096](https://togithub.com/arrow-kt/arrow/pull/3096) - Fix problem with optics and <\*> generics by [@​serras](https://togithub.com/serras) in [https://github.com/arrow-kt/arrow/pull/3097](https://togithub.com/arrow-kt/arrow/pull/3097) - Backport fix for K2 by [@​serras](https://togithub.com/serras) in [https://github.com/arrow-kt/arrow/pull/3098](https://togithub.com/arrow-kt/arrow/pull/3098) - ignoreErrors for Raise by [@​serras](https://togithub.com/serras) in [https://github.com/arrow-kt/arrow/pull/3100](https://togithub.com/arrow-kt/arrow/pull/3100) - Update all dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3085](https://togithub.com/arrow-kt/arrow/pull/3085) - Update all dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3101](https://togithub.com/arrow-kt/arrow/pull/3101) - Update all dependencies to v0.12.0-rc.5 by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3102](https://togithub.com/arrow-kt/arrow/pull/3102) - Update all dependencies to v1.9.0-1.0.12 by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3103](https://togithub.com/arrow-kt/arrow/pull/3103) - Update all dependencies to v5.10.0 by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3104](https://togithub.com/arrow-kt/arrow/pull/3104) - Remove references to shift in Either.kt by [@​nomisRev](https://togithub.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3105](https://togithub.com/arrow-kt/arrow/pull/3105) - Update all dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3106](https://togithub.com/arrow-kt/arrow/pull/3106) - Update dependency org.jetbrains.kotlinx.kover to v0.7.3 by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3107](https://togithub.com/arrow-kt/arrow/pull/3107) - Update all dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3112](https://togithub.com/arrow-kt/arrow/pull/3112) - `parMapNotNull` by [@​raulraja](https://togithub.com/raulraja) in [https://github.com/arrow-kt/arrow/pull/3110](https://togithub.com/arrow-kt/arrow/pull/3110) - `parMapNotNullUnordered` for `Flow` by [@​serras](https://togithub.com/serras) in [https://github.com/arrow-kt/arrow/pull/3111](https://togithub.com/arrow-kt/arrow/pull/3111) - Enable experimental K2 by [@​serras](https://togithub.com/serras) in [https://github.com/arrow-kt/arrow/pull/3087](https://togithub.com/arrow-kt/arrow/pull/3087) - Update all dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3118](https://togithub.com/arrow-kt/arrow/pull/3118) - Update dependency com.diffplug.spotless to v6.21.0 by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3119](https://togithub.com/arrow-kt/arrow/pull/3119) - Inline `NonEmpty` maps by [@​serras](https://togithub.com/serras) in [https://github.com/arrow-kt/arrow/pull/3120](https://togithub.com/arrow-kt/arrow/pull/3120) - Remove enableCompatibilityMetadataVariant by [@​nomisRev](https://togithub.com/nomisRev) in [https://github.com/arrow-kt/arrow/pull/3124](https://togithub.com/arrow-kt/arrow/pull/3124) - Update actions/checkout action to v4 by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3125](https://togithub.com/arrow-kt/arrow/pull/3125) - Update all dependencies by [@​renovate](https://togithub.com/renovate) in [https://github.com/arrow-kt/arrow/pull/3121](https://togithub.com/arrow-kt/arrow/pull/3121) #### New Contributors - [@​wolpl](https://togithub.com/wolpl) made their first contribution in [https://github.com/arrow-kt/arrow/pull/3096](https://togithub.com/arrow-kt/arrow/pull/3096) **Full Changelog**: arrow-kt/arrow@1.2.0...1.2.1 </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about these updates again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/arrow-kt/arrow-website). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44My4wIiwidXBkYXRlZEluVmVyIjoiMzYuODMuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Fixes #3116
This overrides
map
andmapIndexed
withinline
definitions, so they can be used in combination withsuspend
computations. Unfortunately this cannot be provided in general withinNonEmptyCollection
, becauseinline
members are not allowed in interfaces.