aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2013-10-02 21:58:19 +0200
committerLudovic Courtès <ludo@gnu.org>2013-10-03 23:12:20 +0200
commitaeb7ec5c9a67c9936b5d01d6e933cf4c282058d2 (patch)
tree6fc9c9260879b5a359ff5f63668ff3db204c89fb /tests
parentd9f0a23704a038640329fae6e2273e5813cdb8ab (diff)
downloadpatches-aeb7ec5c9a67c9936b5d01d6e933cf4c282058d2.tar
patches-aeb7ec5c9a67c9936b5d01d6e933cf4c282058d2.tar.gz
monads: Allow resolution of a monad's bind/return at expansion time.
* guix/monads.scm (<monad>): Turn in a raw SRFI-9 record type. (define-monad): New macro. (with-monad): Add a case for when MONAD is a macro. (identity-return, identity-bind, store-return, store-bind): Inline. (%identity-monad, %store-monad): Use 'define-monad'. * tests/monads.scm ("monad?"): New test.
Diffstat (limited to 'tests')
-rw-r--r--tests/monads.scm5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/monads.scm b/tests/monads.scm
index 9570c208b2..4608deec9e 100644
--- a/tests/monads.scm
+++ b/tests/monads.scm
@@ -48,6 +48,11 @@
(test-begin "monads")
+(test-assert "monad?"
+ (and (every monad? %monads)
+ (every (compose procedure? monad-bind) %monads)
+ (every (compose procedure? monad-return) %monads)))
+
;; The 3 "monad laws": <http://www.haskell.org/haskellwiki/Monad_laws>.
(test-assert "left identity"