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

map

@JvmName("map") fun <L, A, B> Kind<Kind<ForEither, L>, A>.~~map~~(arg1: (A) -> B): Either<L, 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.either.functor.*
import arrow.core.*


 import arrow.core.extensions.either.applicative.just

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

Do you like Arrow?

Arrow Org
<