nee-core / dev.neeffect.nee / Effects

Effects

class Effects<R1, R2 : R1, E1, E2> : Effect<R2, Either<E1, E2>>

Constructors

<init>

Effects(inner: Effect<R1, E1>, outer: Effect<R2, E2>)

Functions

wrap

Wrap a business function in a given effect

fun <A, P> wrap(f: (R2) -> (P) -> A): (R2) -> Pair<(P) -> Out<Either<E1, E2>, A>, R2>

Companion Object Functions

combine

fun <R1, R2 : R1, E1, E2> combine(outer: Effect<R1, E1>, inner: Effect<R2, E2>): Effect<R2, Either<E1, E2>>

Extension Functions

andThen

Composition of effects.

fun <R1, E1, R2 : R1, E2> Effect<R2, E2>.andThen(otherEffect: Effect<R1, E1>): Effect<R2, Either<E1, E2>>

anyError

fun <R, E> Effect<R, E>.anyError(): Effect<R, Any>

then

infix fun <R1, E1, R2 : R1, E2> Effect<R2, E2>.then(otherEffect: Effect<R1, E1>): Effect<R2, Either<E1, E2>>