View Source state_t (erlandono v3.1.3)

Summary

Types

-opaque state_t(S, M, A)

Functions

-spec '>>='(state_t(S, M, A), fun((A) -> state_t(S, M, B)), M) -> state_t(S, M, B).
-spec eval(state_t(S, M, A), S, M) -> monad:monadic(M, A).
-spec exec(state_t(S, M, _A), S, M) -> monad:monadic(M, S).
-spec fail(any(), M) -> state_t(_S, M, _A).
-spec get(M) -> state_t(S, M, S).
-spec lift(monad:monadic(M, A), M) -> state_t(_S, M, A).
-spec modify(fun((S) -> S), M) -> state_t(S, M, ok).
Link to this function

modify_and_return(Fun, M)

View Source
-spec modify_and_return(fun((S) -> {A, S}), M) -> state_t(S, M, A).
-spec new(M) -> TM when TM :: monad:monad(), M :: monad:monad().
-spec put(S, M) -> state_t(S, M, ok).
-spec return(A, M) -> state_t(_S, M, A).
-spec run(state_t(S, M, A), S, M) -> monad:monadic(M, {A, S}).