View Source state_t (erlandono v3.1.3)
Summary
Types
-opaque state_t(S, M, A)
Functions
-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 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).
-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}).