Skip to content
This repository has been archived by the owner on Feb 24, 2021. It is now read-only.

Deprecate @higherkind & @extension for ListK #276

Merged
merged 49 commits into from Jan 6, 2021

Conversation

nomisRev
Copy link
Member

@nomisRev nomisRev commented Dec 19, 2020

  • Eq (EqK, EqK2)
  • Order
  • Hash
  • Show
  • Semigroup (SemigroupK)
  • Monoid (MonoidK)
  • Functor
  • Apply
  • Applicative
  • Monad
  • Traverse
  • Foldable
  • Crosswalk
  • MonadLogic
  • MonadPlus
  • Alternative
  • Align
  • MonadFilter
  • MonadCombine
  • Monoidal
  • Semigroupal
  • Semialign
  • Unalign
  • Zip
  • Unzip

@nomisRev nomisRev marked this pull request as draft December 19, 2020 19:33
): List<K> =
mapN(b, c, d, e, f, g, h, i, j, unit) { b, c, d, e, f, g, h, i, j, _ -> map(b, c, d, e, f, g, h, i, j) }

inline fun <B, C, D, E, F, G, H, I, J, K, L> mapN(
Copy link
Member Author

Choose a reason for hiding this comment

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

These signatures are conflicting with the ones defined for Nullable.kt :( Any suggestions?
https://github.com/arrow-kt/arrow-core/blob/master/arrow-core-data/src/main/kotlin/arrow/core/Nullable.kt#L28

Copy link
Member Author

@nomisRev nomisRev Dec 20, 2020

Choose a reason for hiding this comment

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

This will need 2 deprecation cycles.

  1. Deprecate top-level mapN in favor on object Nullable, add mapN for List on ListK, add mapN for Map on MapK, ...
  2. Remove top-level mapN for nullable, deprecate mapN for List and Map in favor of top-level mapN function

@nomisRev nomisRev marked this pull request as ready for review January 4, 2021 12:16
fun <A> List<A>.hashWithSalt(HA: Hash<A>, arg1: Int): Int =
_hashWithSalt(HA, arg1)

object List {
Copy link
Member

Choose a reason for hiding this comment

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

nit, this object may need deprecation too if someone has ever projected other functions on it beside using ours

internal val semigroupal_singleton: ListKSemigroupal = object :
arrow.core.extensions.ListKSemigroupal {}

object List {
Copy link
Member

Choose a reason for hiding this comment

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

May need deprecation

@@ -108,7 +101,6 @@ interface ListKApply : Apply<ForListK> {
fix().map2(fb, f)
}

@extension
Copy link
Member

Choose a reason for hiding this comment

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

🥳

Copy link
Member

@raulraja raulraja left a comment

Choose a reason for hiding this comment

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

Thanks @nomisRev !

@franciscodr
Copy link
Contributor

Great job, @nomisRev!

* cached extension
*/
@PublishedApi()
internal val monad_singleton: ListKMonad = object : arrow.core.extensions.ListKMonad {}
Copy link
Member

Choose a reason for hiding this comment

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

Does this needs to be deprecated, too?

Copy link
Member Author

Choose a reason for hiding this comment

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

No, it's internal to Arrow so no need to deprecate it. It's only used in the same file.

Copy link
Member

@i-walker i-walker left a comment

Choose a reason for hiding this comment

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

Thanks @nomisRev 🙌
Just left a question

@raulraja raulraja merged commit 2cbd45c into master Jan 6, 2021
@raulraja raulraja deleted the sv-deprecate-extensions-list branch January 6, 2021 19:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants