From b734996f9cf395705860703422d5e92565dd3a13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Wed, 27 May 2015 09:40:19 +0200 Subject: monads: 'foldm', 'mapm', and 'anym' now take a list of regular values. * guix/monads.scm (foldm, mapm, anym): Change to take a list of regular values as is customary. * tests/monads.scm ("mapm", "anym"): Adjust accordingly. --- tests/monads.scm | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'tests/monads.scm') diff --git a/tests/monads.scm b/tests/monads.scm index 57a8e66797..5529a6188a 100644 --- a/tests/monads.scm +++ b/tests/monads.scm @@ -163,7 +163,7 @@ (test-assert "mapm" (every (lambda (monad run) (with-monad monad - (equal? (run (mapm monad (lift1 1+ monad) (map return (iota 10)))) + (equal? (run (mapm monad (lift1 1+ monad) (iota 10))) (map 1+ (iota 10))))) %monads %monad-run)) @@ -202,11 +202,12 @@ (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)))) + (anym monad + (lift1 (lambda (x) + (and (odd? x) 'odd!)) + monad) + (append (make-list 1000 0) + (list 1 2))))) 'odd!)) %monads %monad-run)) -- cgit v1.2.3