arrow-core / arrow.core.extensions.option.functor / arrow.Kind / fproduct

fproduct

@JvmName("fproduct") fun <A, B> Kind<ForOption, A>.~~fproduct~~(arg1: (A) -> B): Option<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.extensions.option.applicative.just
import arrow.core.extensions.option.functor.fproduct

fun main(args: Array<String>) {
 val result =
 //sampleStart
 "Hello".just().fproduct({ "$it World" })
 //sampleEnd
 println(result)
}

Do you like Arrow?

Arrow Org
<