aboutsummaryrefslogtreecommitdiff
path: root/guix
diff options
context:
space:
mode:
authorChris Marusich <cmmarusich@gmail.com>2017-04-06 02:28:35 -0700
committerLudovic Courtès <ludo@gnu.org>2017-04-08 14:40:51 +0200
commit60a9fcb1377e4acc78a930904ef80b69a1c63f25 (patch)
treed82276055478fe01a529080443273e5214ace344 /guix
parentd922c8e4b773407ca525360e8c564484db34db07 (diff)
downloadgnu-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 'guix')
-rw-r--r--guix/monads.scm12
1 files changed, 8 insertions, 4 deletions
diff --git a/guix/monads.scm b/guix/monads.scm
index 6933f7f151..fe3d5d78f1 100644
--- a/guix/monads.scm
+++ b/guix/monads.scm
@@ -204,8 +204,10 @@ the last one."
(define-syntax mwhen
(syntax-rules ()
- "When CONDITION is true, evaluate MEXP0..MEXP* as in an 'mbegin'. When
-CONDITION is false, return *unspecified* in the current monad."
+ "When CONDITION is true, evaluate the sequence of monadic expressions
+MEXP0..MEXP* as in an 'mbegin'. When CONDITION is false, return *unspecified*
+in the current monad. Every expression in the sequence must be a monadic
+expression."
((_ condition mexp0 mexp* ...)
(if condition
(mbegin %current-monad
@@ -214,8 +216,10 @@ CONDITION is false, return *unspecified* in the current monad."
(define-syntax munless
(syntax-rules ()
- "When CONDITION is false, evaluate MEXP0..MEXP* as in an 'mbegin'. When
-CONDITION is true, return *unspecified* in the current monad."
+ "When CONDITION is false, evaluate the sequence of monadic expressions
+MEXP0..MEXP* as in an 'mbegin'. When CONDITION is true, return *unspecified*
+in the current monad. Every expression in the sequence must be a monadic
+expression."
((_ condition mexp0 mexp* ...)
(if condition
(return *unspecified*)