widen

fun <A, C, B : C> Either<A, B>.widen(): Either<A, C>(source)

Given B is a sub type of C, re-type this value from Either to Either

import arrow.core.*

fun main(args: Array<String>) {
//sampleStart
val string: Either<Int, String> = "Hello".right()
val chars: Either<Int, CharSequence> =
string.widen<Int, CharSequence, String>()
//sampleEnd
println(chars)
}

fun <A, C, B : C> Ior<A, B>.widen(): Ior<A, C>(source)

Given B is a sub type of C, re-type this value from Ior to Ior

import arrow.core.*

fun main(args: Array<String>) {
//sampleStart
val string: Ior<Int, String> = Ior.Right("Hello")
val chars: Ior<Int, CharSequence> =
string.widen<Int, CharSequence, String>()
//sampleEnd
println(chars)
}

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

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

Kind -> Kind


fun <K, B, A : B> Map<K, A>.widen(): Map<K, B>(source)


fun <B, A : B> Option<A>.widen(): Option<B>(source)

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

Option -> Option


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

Kind -> Kind


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

import arrow.core.*

fun main(args: Array<String>) {
//sampleStart
val string: Validated<Int, String> = "Hello".valid()
val chars: Validated<Int, CharSequence> =
string.widen<Int, CharSequence, String>()
//sampleEnd
println(chars)
}