diff options
author | Chris Marusich <cmmarusich@gmail.com> | 2017-04-06 02:28:35 -0700 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2017-04-08 14:40:51 +0200 |
commit | 60a9fcb1377e4acc78a930904ef80b69a1c63f25 (patch) | |
tree | d82276055478fe01a529080443273e5214ace344 /doc/guix.texi | |
parent | d922c8e4b773407ca525360e8c564484db34db07 (diff) | |
download | gnu-guix-60a9fcb1377e4acc78a930904ef80b69a1c63f25.tar gnu-guix-60a9fcb1377e4acc78a930904ef80b69a1c63f25.tar.gz |
monads, doc: Improve mwhen and munless documentation.
* doc/guix.texi (The Store Monad) <mwhen, munless>: Document them.
* guix/monads.scm (mwhen, munless): Clarify their intended use.
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'doc/guix.texi')
-rw-r--r-- | doc/guix.texi | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/doc/guix.texi b/doc/guix.texi index d0f21edeec..62f4483b85 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -4054,6 +4054,20 @@ monadic expressions are ignored. In that sense, it is analogous to @code{begin}, but applied to monadic expressions. @end deffn +@deffn {Scheme System} mwhen @var{condition} @var{mexp0} @var{mexp*} ... +When @var{condition} is true, evaluate the sequence of monadic +expressions @var{mexp0}..@var{mexp*} as in an @code{mbegin}. When +@var{condition} is false, return @code{*unspecified*} in the current +monad. Every expression in the sequence must be a monadic expression. +@end deffn + +@deffn {Scheme System} munless @var{condition} @var{mexp0} @var{mexp*} ... +When @var{condition} is false, evaluate the sequence of monadic +expressions @var{mexp0}..@var{mexp*} as in an @code{mbegin}. When +@var{condition} is true, return @code{*unspecified*} in the current +monad. Every expression in the sequence must be a monadic expression. +@end deffn + @cindex state monad The @code{(guix monads)} module provides the @dfn{state monad}, which allows an additional value---the state---to be @emph{threaded} through |