mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-04-06 21:20:33 +02:00
monads: Fix 'anym'.
* guix/monads.scm (anym): Fix successful case.
* tests/monads.scm ("anym"): New test.
This commit is contained in:
@@ -163,6 +163,18 @@
|
||||
%monads
|
||||
%monad-run))
|
||||
|
||||
(test-assert "anym"
|
||||
(every (lambda (monad run)
|
||||
(eq? (run (with-monad monad
|
||||
(let ((lst (list (return 1) (return 2) (return 3))))
|
||||
(anym monad
|
||||
(lambda (x)
|
||||
(and (odd? x) 'odd!))
|
||||
lst))))
|
||||
'odd!))
|
||||
%monads
|
||||
%monad-run))
|
||||
|
||||
(test-end "monads")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user