sequence

fun <A, B, C> Either<A, Validated<B, C>>.sequence(): Validated<B, Either<A, C>>
fun <A, B> Ior<A, Iterable<B>>.sequence(): List<Ior<A, B>>
fun <A, B, C> Ior<A, Either<B, C>>.sequence(): Either<B, Ior<A, C>>
fun <A, B> Ior<A, Option<B>>.sequence(): Option<Ior<A, B>>
fun <A, B> Ior<A, B?>.sequence(): Ior<A, B>?
fun <A, B, C> Ior<A, Validated<B, C>>.sequence(): Validated<B, Ior<A, C>>
fun <E, A> Iterable<Either<E, A>>.sequence(): Either<E, List<A>>
fun <E, A> Iterable<Validated<E, A>>.sequence(semigroup: Semigroup<E>): Validated<E, List<A>>
fun <A> Iterable<A?>.sequence(): List<A>?
fun <A, B> Option<Either<A, B>>.sequence(): Either<A, Option<B>>
fun <E, A> Sequence<Either<E, A>>.sequence(): Either<E, List<A>>
fun <E, A> Sequence<Validated<E, A>>.sequence(semigroup: Semigroup<E>): Validated<E, List<A>>
fun <E, A, B> Validated<A, Either<E, B>>.sequence(): Either<E, Validated<A, B>>
fun <A, B> Validated<A, B?>.sequence(): Validated<A, B>?
fun <K, E, A> Map<K, Either<E, A>>.sequence(): Either<E, Map<K, A>>
fun <K, E, A> Map<K, Validated<E, A>>.sequence(semigroup: Semigroup<E>): Validated<E, Map<K, A>>
fun <K, V> Map<K, Option<V>>.sequence(): Option<Map<K, V>>


fun <A, B> Either<A, Iterable<B>>.sequence(): List<Either<A, B>>

Deprecated

Prefer Kotlin nullable syntax inside either DSL, or replace with explicit fold

Replace with

import arrow.core.right
fold({ emptyList() }, { iterable -> iterable.map { it.right() } })

fun <A, B> Either<A, Option<B>>.sequence(): Option<Either<A, B>>

Deprecated

Prefer Kotlin nullable syntax inside either DSL, or replace with explicit fold

Replace with

import arrow.core.toOption
import arrow.core.right
import arrow.core.left
orNull()?.orNull()?.right().toOption()

fun <A, B> Either<A, B?>.sequence(): Either<A, B>?

Deprecated

Prefer Kotlin nullable syntax

Replace with

import arrow.core.right
orNull()?.right()