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

fproduct

@JvmName("fproduct") fun <X, A, B> Kind<Kind<ForAndThen, X>, A>.~~fproduct~~(arg1: (A) -> B): AndThen<X, Tuple2<A, B>> Deprecated: AndThen is deprecated in favor of the function andThen used to provide stack safe function composition.

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.andthen.functor.*
import arrow.core.*


 import arrow.core.extensions.andthen.applicative.just

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

Do you like Arrow?

Arrow Org
<