arrow-core-data / arrow.core / kotlin.collections.Iterable / widen

widen

fun <B, A : B> Iterable<A>.widen(): Iterable<B>

Given A is a sub type of B, re-type this value from Iterable to Iterable

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

import arrow.core.*

fun main(args: Array<String>) {
 //sampleStart
 val result: Iterable<CharSequence> =
   listOf("Hello World").widen()
 //sampleEnd
 println(result)
}

Do you like Arrow?

Arrow Org
<