arrow-core / arrow.core.extensions.tuple2.functor / arrow.Kind / map

map

@JvmName("map") fun <F, A, B> Kind<Kind<ForTuple2, F>, A>.~~map~~(arg1: (A) -> B): Tuple2<F, B> Deprecated: @extension kinded projected functions are deprecated

Transform the F wrapped value A into B preserving the F structure Kind<F, A> -> Kind<F, B>

 import arrow.core.*
import arrow.core.extensions.tuple2.functor.*
import arrow.core.*


 import arrow.core.extensions.tuple2.applicative.just
import arrow.core.extensions.monoid

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

Do you like Arrow?

Arrow Org
<