Deprecate @higherkind & @extension for ListK #276
Conversation
nomisRev
commented
Dec 19, 2020
•
edited
edited
- 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
): 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( |
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.
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
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.
This will need 2 deprecation cycles.
- Deprecate top-level
mapN
in favor onobject Nullable
, addmapN
forList
onListK
, addmapN
forMap
onMapK
, ... - Remove top-level
mapN
fornullable
, deprecatemapN
forList
andMap
in favor of top-levelmapN
function
fun <A> List<A>.hashWithSalt(HA: Hash<A>, arg1: Int): Int = | ||
_hashWithSalt(HA, arg1) | ||
|
||
object List { |
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.
nit, this object may need deprecation too if someone has ever projected other functions on it beside using ours
arrow-core/src/main/kotlin/arrow/core/extensions/list/monad/ListKMonad.kt
Outdated
Show resolved
Hide resolved
internal val semigroupal_singleton: ListKSemigroupal = object : | ||
arrow.core.extensions.ListKSemigroupal {} | ||
|
||
object List { |
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.
May need deprecation
@@ -108,7 +101,6 @@ interface ListKApply : Apply<ForListK> { | |||
fix().map2(fb, f) | |||
} | |||
|
|||
@extension |
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.
🥳
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 @nomisRev !
…stKMonad.kt Co-authored-by: Raúl Raja Martínez <raulraja@gmail.com>
Great job, @nomisRev! |
* cached extension | ||
*/ | ||
@PublishedApi() | ||
internal val monad_singleton: ListKMonad = object : arrow.core.extensions.ListKMonad {} |
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.
Does this needs to be deprecated, too?
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.
No, it's internal
to Arrow so no need to deprecate it. It's only used in the same file.
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 @nomisRev 🙌
Just left a question