nee-core / dev.neeffect.nee

Package dev.neeffect.nee

Types

ANee

Nee returning Any error.

typealias ANee<R, A> = Nee<R, Any, A>

Effect

An effect, or maybe aspect :-)

interface Effect<R, E>

Effects

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

HandleErrorEffect

class HandleErrorEffect<R, E, E1> : Effect<R, E1>

Nee

Nee monad.

sealed class Nee<R, E, out A>

NoEffect

class NoEffect<R, E> : Effect<R, E>

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>

noEffect

fun <R, E> noEffect(): NoEffect<R, E>

plus

operator fun <R1, E1, R2 : R1, E2 : E1> Effect<R2, E2>.plus(otherEffect: Effect<R1, E1>): Effect<R2, E1>

then

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

with

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