arrow-core / arrow.core.extensions.eval.functor / arrow.Kind / widen

widen

@JvmName("widen") fun <B, A : B> Kind<ForEval, A>.~~widen~~(): Eval<B> Deprecated: @extension kinded projected functions are deprecated

Given A is a sub type of B, re-type this value from Kind<F, A> to Kind<F, B>

Kind<F, A> -> Kind<F, B>

 import arrow.core.*
import arrow.core.extensions.eval.functor.*
import arrow.core.*


 import arrow.core.extensions.eval.applicative.just
 import arrow.Kind

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

Do you like Arrow?

Arrow Org
<