Liking cljdoc? Tell your friends :D

blancas.morph.transf

Monads Transformers.

Monads Transformers.
raw docstring

->eithercljmacro

(->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.
sourceraw docstring

->leftclj

(->left x)

Makes a Left value inside a State.

Makes a Left value inside a State.
sourceraw docstring

->rightclj

(->right x)

Makes a Right value inside a State.

Makes a Right value inside a State.
sourceraw docstring

ask-rtclj

(ask-rt ret)

Returns a ReaderT whose inner monad contains the environment.

Returns a ReaderT whose inner monad contains the environment.
sourceraw docstring

asks-rtclj

(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.
sourceraw docstring

eval-just-tclj

(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.
sourceraw docstring

eval-seclj

(eval-se m s)

Returns the inner monad as a Right value.

Returns the inner monad as a Right value.
sourceraw docstring

eval-state-tclj

(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.
sourceraw docstring

eval-writer-tclj

(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).
sourceraw docstring

exec-seclj

(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.
sourceraw docstring

exec-state-tclj

(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.
sourceraw docstring

exec-writer-tclj

(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).
sourceraw docstring

fail-etclj

(fail-et im)

Lifts an inner monad into the outer Left monad.

Lifts an inner monad into the outer Left monad.
sourceraw docstring

get-seclj

Gets the outer monad's state as a Right value.

Gets the outer monad's state as a Right value.
sourceraw docstring

get-stclj

(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.
sourceraw docstring

gets-seclj

(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.
sourceraw docstring

gets-stclj

(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.
sourceraw docstring

just-tclj

(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).
sourceraw docstring

left-tclj

(left-t ret x)

Constructor for an inner monad with a Left value.

Constructor for an inner monad with a Left value.
sourceraw docstring

lift-etclj

(lift-et im)

Lifts an inner monad into the outer Right monad.

Lifts an inner monad into the outer Right monad.
sourceraw docstring

lift-mtclj

(lift-mt im)

Lifts an inner monad into the outer MaybeT monad.

Lifts an inner monad into the outer MaybeT monad.
sourceraw docstring

lift-rtclj

(lift-rt im)

Lifts an inner monad into the outer ReaderT monad.

Lifts an inner monad into the outer ReaderT monad.
sourceraw docstring

lift-stclj

(lift-st im)

Lifts an inner monad into the outer StateT monad.

Lifts an inner monad into the outer StateT monad.
sourceraw docstring

lift-wtclj

(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.
sourceraw docstring

listen-wtclj

(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).
sourceraw docstring

listens-wtclj

(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).
sourceraw docstring

local-rtclj

(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.
sourceraw docstring

modify-seclj

(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.
sourceraw docstring

modify-stclj

(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.
sourceraw docstring

nothing-tclj

(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.
sourceraw docstring

pass-wtclj

(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.
sourceraw docstring

put-seclj

(put-se s)

Sets the outer monad's state.

Sets the outer monad's state.
sourceraw docstring

put-stclj

(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.
sourceraw docstring

reader-tclj

(reader-t ret x)

Reader monad constructor.

Reader monad constructor.
sourceraw docstring

right-tclj

(right-t ret x)

Constructor for an inner monad with a Right value.

Constructor for an inner monad with a Right value.
sourceraw docstring

run-either-tclj

(run-either-t m)

Returns the inner monad, which contains an Either value.

Returns the inner monad, which contains an Either value.
sourceraw docstring

run-just-tclj

(run-just-t m)

Returns the inner monad, which contains a Maybe value.

Returns the inner monad, which contains a Maybe value.
sourceraw docstring

run-left-tclj

(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
sourceraw docstring

run-reader-tclj

(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.
sourceraw docstring

run-right-tclj

(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
sourceraw docstring

run-seclj

(run-se m s)

Returns the Either inner monad.

Returns the Either inner monad.
sourceraw docstring

run-state-tclj

(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.
sourceraw docstring

run-writer-tclj

(run-writer-t m)

Returns the inner monad.

Returns the inner monad.
sourceraw docstring

state-tclj

(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.
sourceraw docstring

tell-wtclj

(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.
sourceraw docstring

writer-tclj

(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.
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close