sealed class Nee<R, E, P, out A>
Nee monad.
Naive enterprise effects Wraps business function inside some "effects".
R - environment to run function on
P - param of function (business)
//CONTROVERSIAL P is only added to handle caching
E - error that can happen (because of effects)
anyError |
fun anyError(): ANee<R, P, A> |
constP |
fun constP(): (P) -> Nee<R, E, Unit, A> |
flatMap |
abstract fun <B> flatMap(f: (A) -> Nee<R, E, P, B>): Nee<R, E, P, B> |
map |
abstract fun <B> map(f: (A) -> B): Nee<R, E, P, B> |
perform |
Call Nee with given environment. abstract fun perform(env: R): (P) -> Out<E, A> |
constP |
fun <R, E, A> constP(effect: Effect<R, E>, func: (R) -> A): Nee<R, E, Unit, A> |
constR |
fun <R, E, P, A> constR(effect: Effect<R, E>, func: (P) -> A): Nee<R, E, P, A> |
flatOut |
fun <R, E, P, A, E1 : E> flatOut(f: Nee<R, E, P, Out<E1, A>>): <ERROR CLASS> |
pure |
fun <R, E, P, A> pure(a: A): Nee<R, E, P, A>fun <R, E, P, A> pure(effect: Effect<R, E>, func: (R) -> (P) -> A): Nee<R, E, P, A> |