arrow-core / arrow.core.extensions.const.functor / arrow.Kind / fproduct
@JvmName("fproduct") fun <A, B> Kind<Kind<ForConst, A>, A>.~~fproduct~~(arg1: (A) -> B): Const<A, Tuple2<A, B>>
Deprecated: @extension kinded projected functions are deprecated
Applies f to an A inside F and returns the F structure with a tuple of the A value and the computed B value as result of applying f
Kind<F, A> -> Kind<F, Tuple2<A, B>>
import arrow.core.*
import arrow.core.extensions.const.functor.*
import arrow.core.*
import arrow.core.extensions.const.applicative.just
import arrow.core.extensions.monoid
fun main(args: Array<String>) {
val result =
//sampleStart
"Hello".just<String>(String.monoid()).fproduct<String, String>({ "$it World" })
//sampleEnd
println(result)
}
Do you like Arrow?
✖