blancas.morph.transf documentation
->EitherT
(->EitherT ret im)
Positional factory function for class blancas.morph.transf.EitherT.
->MaybeT
(->MaybeT ret im)
Positional factory function for class blancas.morph.transf.MaybeT.
->ReaderT
(->ReaderT ret run)
Positional factory function for class blancas.morph.transf.ReaderT.
->StateT
(->StateT ret run)
Positional factory function for class blancas.morph.transf.StateT.
->WriterT
(->WriterT ret me im)
Positional factory function for class blancas.morph.transf.WriterT.
->either
macro
(->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.
->left
(->left x)
Makes a Left value inside a State.
->right
(->right x)
Makes a Right value inside a State.
ask-rt
(ask-rt ret)
Returns a ReaderT whose inner monad contains the environment.
asks-rt
(asks-rt ret f)
Returns a Reader whose value the result of applying f
to the current environment.
eval-just-t
(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.
eval-se
(eval-se m s)
Returns the inner monad as a Right value.
eval-state-t
(eval-state-t m s)
Performs an action m using the initial state s; returns
the wrapped monad with the resulting value.
eval-writer-t
(eval-writer-t m)
Returns the value part as an instance of the inner monad: m (a).
exec-se
(exec-se m s)
Returns the final state of the outer monad as a Right value.
exec-state-t
(exec-state-t m s)
Performs an action m using the initial state s; returns
the wrapped monad with the resulting state.
exec-writer-t
(exec-writer-t m)
Returns the output part as an instance of the inner monad: m (w).
fail-et
(fail-et im)
Lifts an inner monad into the outer Left monad.
get-se
Gets the outer monad's state as a Right value.
get-st
(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-se
(gets-se f)
Like get-st, but applies the function f (usually a selector)
on the state being return as a Right value.
gets-st
(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.
just-t
(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).
left-t
(left-t ret x)
Constructor for an inner monad with a Left value.
lift-et
(lift-et im)
Lifts an inner monad into the outer Right monad.
lift-mt
(lift-mt im)
Lifts an inner monad into the outer MaybeT monad.
lift-rt
(lift-rt im)
Lifts an inner monad into the outer ReaderT monad.
lift-st
(lift-st im)
Lifts an inner monad into the outer StateT monad.
lift-wt
(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.
listen-wt
(listen-wt m)
Allows chained WriterT's to peek at the current output w
by returning a value as a pair (a, w).
listens-wt
(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).
local-rt
(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.
modify-se
(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.
modify-st
(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.
nothing-t
(nothing-t ret)
MaybeT constructor that uses the constructor of the inner monad
(its return function) to wrap a Nothing value.
pass-wt
(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.
put-se
(put-se s)
Sets the outer monad's state.
put-st
(put-st ret s)
Sets the outer monad's state; uses the given constructor
to return that state in the inner monad.
reader-t
(reader-t ret x)
Reader monad constructor.
right-t
(right-t ret x)
Constructor for an inner monad with a Right value.
run-either-t
(run-either-t m)
Returns the inner monad, which contains an Either value.
run-just-t
(run-just-t m)
Returns the inner monad, which contains a Maybe value.
run-left-t
(run-left-t m)
Accessor for the left value as an instance of the inner monad;
in effect: m (Either e a) -> m e
run-reader-t
(run-reader-t m e)
Performs a Reader action m with an environment e.
Returns the inner monad produced by the action.
run-right-t
(run-right-t m)
Accessor for the right value as an instance of the inner monad;
in effect: m (Either e a) -> m a
run-se
(run-se m s)
Returns the Either inner monad.
run-state-t
(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.
run-writer-t
(run-writer-t m)
Returns the inner monad.
state-t
(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.
tell-wt
(tell-wt ret x)
Returns a WriterT with output x, using the inner monad
constructor ret.
writer-t
(writer-t ret a w)
(writer-t m im)
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.