aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--algebraic-structures.monoid.fold.scm2
-rw-r--r--tests/run.scm3
2 files changed, 4 insertions, 1 deletions
diff --git a/algebraic-structures.monoid.fold.scm b/algebraic-structures.monoid.fold.scm
index 5e176f2..bb74e4a 100644
--- a/algebraic-structures.monoid.fold.scm
+++ b/algebraic-structures.monoid.fold.scm
@@ -1,4 +1,4 @@
-(functor ((algebraic-structures monoid fold) (M (<> unit)) (F (fold))) (fold)
+(functor ((algebraic-structures monoid fold) (M (<> unit)) (F (fold))) (fold fold-map)
(import scheme M (rename F (fold foldable:fold)))
(define (fold x) (foldable:fold <> unit x))
diff --git a/tests/run.scm b/tests/run.scm
index be0845b..4b2b885 100644
--- a/tests/run.scm
+++ b/tests/run.scm
@@ -144,7 +144,10 @@
(import (prefix (product monoid) product:))
(import (prefix (product fold) product:))
+(test 1 (product:fold '()))
(test 120 (product:fold '(1 2 3 4 5)))
+(test 1 (product:fold-map error '()))
+(test 6 (product:fold-map length '((a a a) (a a) (a))))
(test-end "monoid.fold")