Monads Transformers.
Monads Transformers.
(->either form)
(->either message form)
(->either message pred form)
Makes an Either value inside a State; may be a Left or Right. It takes a value or a form that may evaluate to nil or throw an exception, both of which cases result in a Left value; otherwise it is a Right.
Makes an Either value inside a State; may be a Left or Right. It takes a value or a form that may evaluate to nil or throw an exception, both of which cases result in a Left value; otherwise it is a Right.
(->left x)
Makes a Left value inside a State.
Makes a Left value inside a State.
(->right x)
Makes a Right value inside a State.
Makes a Right value inside a State.
(ask-rt ret)
Returns a ReaderT whose inner monad contains the environment.
Returns a ReaderT whose inner monad contains the environment.
(asks-rt ret f)
Returns a Reader whose value the result of applying f to the current environment.
Returns a Reader whose value the result of applying f to the current environment.
(eval-just-t m)
Returns the Just value inside the inner monad in a new instance; thus, from m (Just a) it returns m a.
Returns the Just value inside the inner monad in a new instance; thus, from m (Just a) it returns m a.
(eval-se m s)
Returns the inner monad as a Right value.
Returns the inner monad as a Right value.
(eval-state-t m s)
Performs an action m using the initial state s; returns the wrapped monad with the resulting value.
Performs an action m using the initial state s; returns the wrapped monad with the resulting value.
(eval-writer-t m)
Returns the value part as an instance of the inner monad: m (a).
Returns the value part as an instance of the inner monad: m (a).
(exec-se m s)
Returns the final state of the outer monad as a Right value.
Returns the final state of the outer monad as a Right value.
(exec-state-t m s)
Performs an action m using the initial state s; returns the wrapped monad with the resulting state.
Performs an action m using the initial state s; returns the wrapped monad with the resulting state.
(exec-writer-t m)
Returns the output part as an instance of the inner monad: m (w).
Returns the output part as an instance of the inner monad: m (w).
(fail-et im)
Lifts an inner monad into the outer Left monad.
Lifts an inner monad into the outer Left monad.
Gets the outer monad's state as a Right value.
Gets the outer monad's state as a Right value.
(get-st ret)
Gets the outer monad's state; uses the given constructor to return that state as the value of the inner monad.
Gets the outer monad's state; uses the given constructor to return that state as the value of the inner monad.
(gets-se f)
Like get-st, but applies the function f (usually a selector) on the state being return as a Right value.
Like get-st, but applies the function f (usually a selector) on the state being return as a Right value.
(gets-st ret f)
Like get-st, but applies the function f (usually a selector) on the state being return as the value of the inner monad.
Like get-st, but applies the function f (usually a selector) on the state being return as the value of the inner monad.
(just-t ret x)
MaybeT constructor that uses the constructor of the inner monad (its return function) and a value for its Just instance, such that the result is: Monad (Just x).
MaybeT constructor that uses the constructor of the inner monad (its return function) and a value for its Just instance, such that the result is: Monad (Just x).
(left-t ret x)
Constructor for an inner monad with a Left value.
Constructor for an inner monad with a Left value.
(lift-et im)
Lifts an inner monad into the outer Right monad.
Lifts an inner monad into the outer Right monad.
(lift-mt im)
Lifts an inner monad into the outer MaybeT monad.
Lifts an inner monad into the outer MaybeT monad.
(lift-rt im)
Lifts an inner monad into the outer ReaderT monad.
Lifts an inner monad into the outer ReaderT monad.
(lift-st im)
Lifts an inner monad into the outer StateT monad.
Lifts an inner monad into the outer StateT monad.
(lift-wt im)
(lift-wt im w)
Lifts an inner monad into the outer WriterT monad with an output value w, which defaults to the empty vector.
Lifts an inner monad into the outer WriterT monad with an output value w, which defaults to the empty vector.
(listen-wt m)
Allows chained WriterT's to peek at the current output w by returning a value as a pair (a, w).
Allows chained WriterT's to peek at the current output w by returning a value as a pair (a, w).
(listens-wt f m)
Allows chained WriterT's to peek at the current output w by returning a value as a pair (a, f w).
Allows chained WriterT's to peek at the current output w by returning a value as a pair (a, f w).
(local-rt ret f m)
Returns a Reader whose value is the result of running the Reader m under a changed environment, which is produced by applying f on the previous environment.
Returns a Reader whose value is the result of running the Reader m under a changed environment, which is produced by applying f on the previous environment.
(modify-se f & more)
Tranforms the outer monad's state, to be returned as a Right value. The function f is applied on the current state, along with any optional arguments.
Tranforms the outer monad's state, to be returned as a Right value. The function f is applied on the current state, along with any optional arguments.
(modify-st ret f & more)
Tranforms the outer monad's state; uses the given constructor to return that state in the inner monad. The function f is applied on the current state, along with any optional arguments.
Tranforms the outer monad's state; uses the given constructor to return that state in the inner monad. The function f is applied on the current state, along with any optional arguments.
(nothing-t ret)
MaybeT constructor that uses the constructor of the inner monad (its return function) to wrap a Nothing value.
MaybeT constructor that uses the constructor of the inner monad (its return function) to wrap a Nothing value.
(pass-wt m)
Performs an action that returns a WriterT similar to (listen-wt), but instead of output it adds an output-transforming function to the value's pair. Returns a WriterT whose output is the result of that function.
Performs an action that returns a WriterT similar to (listen-wt), but instead of output it adds an output-transforming function to the value's pair. Returns a WriterT whose output is the result of that function.
(put-st ret s)
Sets the outer monad's state; uses the given constructor to return that state in the inner monad.
Sets the outer monad's state; uses the given constructor to return that state in the inner monad.
(right-t ret x)
Constructor for an inner monad with a Right value.
Constructor for an inner monad with a Right value.
(run-either-t m)
Returns the inner monad, which contains an Either value.
Returns the inner monad, which contains an Either value.
(run-just-t m)
Returns the inner monad, which contains a Maybe value.
Returns the inner monad, which contains a Maybe value.
(run-left-t m)
Accessor for the left value as an instance of the inner monad; in effect: m (Either e a) -> m e
Accessor for the left value as an instance of the inner monad; in effect: m (Either e a) -> m e
(run-reader-t m e)
Performs a Reader action m with an environment e. Returns the inner monad produced by the action.
Performs a Reader action m with an environment e. Returns the inner monad produced by the action.
(run-right-t m)
Accessor for the right value as an instance of the inner monad; in effect: m (Either e a) -> m a
Accessor for the right value as an instance of the inner monad; in effect: m (Either e a) -> m a
(run-se m s)
Returns the Either inner monad.
Returns the Either inner monad.
(run-state-t m s)
Performs an action m using the initial state s; returns the wrapped monad having a pair of the value and state.
Performs an action m using the initial state s; returns the wrapped monad having a pair of the value and state.
(run-writer-t m)
Returns the inner monad.
Returns the inner monad.
(state-t ret x)
Makes a StateT moand whose value is another monad. The wrapped monad is made out of the constructor ctor and value x.
Makes a StateT moand whose value is another monad. The wrapped monad is made out of the constructor ctor and value x.
(tell-wt ret x)
Returns a WriterT with output x, using the inner monad constructor ret.
Returns a WriterT with output x, using the inner monad constructor ret.
(writer-t m im)
(writer-t ret a w)
WriterT monad constructor. Takes the inner monad, a value, and and output value. Alternatively, for functions that make instances out of existing ones, the second form takes a WriterT and an inner monad value.
WriterT monad constructor. Takes the inner monad, a value, and and output value. Alternatively, for functions that make instances out of existing ones, the second form takes a WriterT and an inner monad value.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close