aboutsummaryrefslogtreecommitdiff
path: root/algebraic-structures.foldable.make.scm
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2024-06-13 02:11:07 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2024-06-13 02:11:07 +0900
commitca1584a5c87c2952af08c74ce80b1cb2a75a1d19 (patch)
tree6a6f5ebde7bb00f8bd74501ecac563c5a1dc51f6 /algebraic-structures.foldable.make.scm
parent653b204b583da363a97464960a00f1bd0dbed865 (diff)
Rename modules from (<feature name> ... make) to (<feature name>)
Diffstat (limited to 'algebraic-structures.foldable.make.scm')
-rw-r--r--algebraic-structures.foldable.make.scm39
1 files changed, 0 insertions, 39 deletions
diff --git a/algebraic-structures.foldable.make.scm b/algebraic-structures.foldable.make.scm
deleted file mode 100644
index 197eb48..0000000
--- a/algebraic-structures.foldable.make.scm
+++ /dev/null
@@ -1,39 +0,0 @@
-(functor ((algebraic-structures foldable make) (F (foldl foldr)))
- (foldl foldr length find any every ->list)
- (import (except scheme length) F
- (only (chicken base) add1 call/cc))
-
- (define (length xs)
- (foldl (lambda (acc _) (add1 acc))
- 0
- xs))
-
- (define (find p? xs)
- (call/cc
- (lambda (k)
- (foldl (lambda (acc e)
- (if (p? e)
- (k e)
- acc))
- #f
- xs))))
-
- (define (any pred xs)
- (call/cc
- (lambda (return)
- (foldl (lambda (acc e)
- (cond ((pred e) => return)
- (else acc)))
- #f
- xs))))
-
- (define (every pred xs)
- (call/cc
- (lambda (return)
- (foldl (lambda (acc e)
- (or (pred e) (return #f)))
- #t
- xs))))
-
- (define (->list xs)
- (foldr cons '() xs)))