`Applicative` enables combining elements using `ma...
# arrow
s
Applicative
enables combining elements using
map
for any number of arguments 🙂
k
that makes me wonder if we find it a good idea to introduce an extension function for applicative. Not the first time someone raising this question 🤔 something like:
Copy code
fun <E, A, E2, B, C> Either<E, A>.zipWith(other: Either<E2, B>, f: (A, B) -> C): C = Either.applicative().map(this, other, f)
do you think it would be a good idea?
s
We’re working on injecting the static methods such as
Applicative map
,
Concurrent parMapN
, etc into the companion object. This’ll enable
Either.map(..., .., ..) { }
just like it would enable the same for all
F
and it’ll be available in the same way in a polymorphic context.
So instead of generating the current methods with global imports we’d like to make them available on the
Companion
. This’ll improve discoverability and it’ll reduce stress on IDEA>
k
assuming the "proper" way would be with an implicit type class object right?
s
That’s how it’ implemented in the language I know that support this. In the end you want the compiler to verify that the code is valid, whether this is a compiler, a plugin or a code generator is impl detail.
👍 3