arrow-kt / arrow-core

Λrrow Core is part of Λrrow, a functional companion to Kotlin's Standard Library
http://arrow-kt.io
Other
81 stars 30 forks source link

Deprecate map2 and product in favor of zip #311

Closed danimontoya closed 3 years ago

danimontoya commented 3 years ago

Fixes https://app.clickup.com/t/cf2n35

Discussed here:

In Arrow we have following signatures for all data-types that implement Apply:

fun <A, B, C> Kind<F, A>.map2(fb: Kind<F, B>, f: (A, B) -> C): Kind<F, C>
fun <A, B> Kind<F, A>.product(fb: Kind<F, B>): Kind<F, Tuple2<A, B>>

these should be deprecated towards new implementations which are the functions names from Kotlin Std

fun <A, B, C> Kind<F, A>.zip(fb: Kind<F, B>, f: (A, B) -> C): Kind<F, C>
fun <A, B> Kind<F, A>.zip(fb: Kind<F, B>): Kind<F, Pair<A, B>>
nomisRev commented 3 years ago

Thanks @danimontoya! Great work 👏 👏 👏