diff options
author | Masaya Tojo <masaya@tojo.tokyo> | 2024-06-13 02:07:46 +0900 |
---|---|---|
committer | Masaya Tojo <masaya@tojo.tokyo> | 2024-06-13 02:07:46 +0900 |
commit | 653b204b583da363a97464960a00f1bd0dbed865 (patch) | |
tree | 5ea996f90f54053601476bfa9cff646d28417bfe /algebraic-structures.applicative.list.base.scm | |
parent | a1b1d10ad5fc505f8b83ac6976e5eb68b87427ff (diff) |
Remove implementations
Diffstat (limited to 'algebraic-structures.applicative.list.base.scm')
-rw-r--r-- | algebraic-structures.applicative.list.base.scm | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/algebraic-structures.applicative.list.base.scm b/algebraic-structures.applicative.list.base.scm deleted file mode 100644 index a8c04d5..0000000 --- a/algebraic-structures.applicative.list.base.scm +++ /dev/null @@ -1,29 +0,0 @@ -(module (algebraic-structures applicative list base) (map pure map2) - (import (except scheme map) - (algebraic-structures functor list) - (only (chicken base) atom? cut) - (only (srfi 1) append! reverse!) - matchable) - - (define (pure x) - (list x)) - - (define (rev-map f lst) - (let loop ((lst lst) - (acc '())) - (match lst - [() acc] - [(h . t) - (loop t (cons (f h) acc))]))) - - (define (product op lst1 lst2) - (let loop ((lst lst1) - (acc '())) - (match lst - [() (reverse! acc)] - [(h . t) - (loop t - (append! (rev-map (cut op h <>) lst2) - acc))]))) - - (define map2 product)) |