aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMasaya Tojo <masaya@tojo.tokyo>2024-06-16 19:25:18 +0900
committerMasaya Tojo <masaya@tojo.tokyo>2024-06-16 19:25:18 +0900
commitc98d8212928d109760c27446eb954c2202596f27 (patch)
treec2547e228b138451dbafa144bd33c4a1502a162d
parent8a249bc142d021b42a1c71876c6adf3d1168f270 (diff)
Import only necessary identifiers
-rw-r--r--algebraic-structures.alternative.scm2
-rw-r--r--algebraic-structures.applicative.scm2
-rw-r--r--algebraic-structures.foldable.scm2
-rw-r--r--algebraic-structures.functor.scm2
-rw-r--r--algebraic-structures.group.scm2
-rw-r--r--algebraic-structures.monad.scm2
-rw-r--r--algebraic-structures.monoid.fold.scm4
-rw-r--r--algebraic-structures.monoid.scm2
-rw-r--r--algebraic-structures.reducible.scm2
-rw-r--r--algebraic-structures.semigroup.reduce.scm4
-rw-r--r--algebraic-structures.semigroup.scm2
11 files changed, 15 insertions, 11 deletions
diff --git a/algebraic-structures.alternative.scm b/algebraic-structures.alternative.scm
index c441689..ffebfc3 100644
--- a/algebraic-structures.alternative.scm
+++ b/algebraic-structures.alternative.scm
@@ -2,7 +2,7 @@
(pure map1 map2 map apply alt empty guard)
(import (except scheme map apply)
(only (chicken base) void)
- A)
+ (only A pure map1 map2 map apply alt empty))
(define (guard b)
(if b
diff --git a/algebraic-structures.applicative.scm b/algebraic-structures.applicative.scm
index 489f76d..a38e616 100644
--- a/algebraic-structures.applicative.scm
+++ b/algebraic-structures.applicative.scm
@@ -2,7 +2,7 @@
(pure map1 map2 map apply)
(import (rename scheme (map scheme:map) (apply scheme:apply))
(only (chicken base) sub1 add1 foldl case-lambda)
- A
+ (only A pure map1 map2)
matchable)
(define (curry-n f n)
diff --git a/algebraic-structures.foldable.scm b/algebraic-structures.foldable.scm
index 4456bac..a4af0ca 100644
--- a/algebraic-structures.foldable.scm
+++ b/algebraic-structures.foldable.scm
@@ -6,7 +6,7 @@
every
member?)
(import (except scheme length)
- F
+ (only F fold)
(only (chicken base) add1 call/cc assert))
(define (length xs)
diff --git a/algebraic-structures.functor.scm b/algebraic-structures.functor.scm
index 2d9b7bd..981e5b5 100644
--- a/algebraic-structures.functor.scm
+++ b/algebraic-structures.functor.scm
@@ -1,2 +1,2 @@
(functor ((algebraic-structures functor) (F (map1))) (map1)
- (import F))
+ (import (only F map1)))
diff --git a/algebraic-structures.group.scm b/algebraic-structures.group.scm
index 6e38eaf..5cac19f 100644
--- a/algebraic-structures.group.scm
+++ b/algebraic-structures.group.scm
@@ -1,6 +1,6 @@
(functor ((algebraic-structures group) (M (<> unit inv)))
(<> unit inv pow)
- (import M
+ (import (only M <> unit inv)
scheme
(chicken base))
diff --git a/algebraic-structures.monad.scm b/algebraic-structures.monad.scm
index 8e906e3..2a7f466 100644
--- a/algebraic-structures.monad.scm
+++ b/algebraic-structures.monad.scm
@@ -5,7 +5,7 @@
(map scheme:map)
(do scheme:do))
(chicken base)
- M)
+ (only M pure map1 map2 map apply >>=))
(import-for-syntax matchable
(chicken syntax)
(only (srfi 1) every last))
diff --git a/algebraic-structures.monoid.fold.scm b/algebraic-structures.monoid.fold.scm
index bb74e4a..73fc64c 100644
--- a/algebraic-structures.monoid.fold.scm
+++ b/algebraic-structures.monoid.fold.scm
@@ -1,5 +1,7 @@
(functor ((algebraic-structures monoid fold) (M (<> unit)) (F (fold))) (fold fold-map)
- (import scheme M (rename F (fold foldable:fold)))
+ (import (except scheme length)
+ (only M <> unit)
+ (rename (only F fold) (fold foldable:fold)))
(define (fold x) (foldable:fold <> unit x))
diff --git a/algebraic-structures.monoid.scm b/algebraic-structures.monoid.scm
index 936d0f1..dcd0e61 100644
--- a/algebraic-structures.monoid.scm
+++ b/algebraic-structures.monoid.scm
@@ -1,3 +1,3 @@
(functor ((algebraic-structures monoid) (F (<> unit)))
(<> unit)
- (import F))
+ (import (only F <> unit)))
diff --git a/algebraic-structures.reducible.scm b/algebraic-structures.reducible.scm
index ce9d1b3..49de2e5 100644
--- a/algebraic-structures.reducible.scm
+++ b/algebraic-structures.reducible.scm
@@ -3,7 +3,7 @@
maximum
minimum)
(import scheme
- R)
+ (only R reduce))
(define (minimum xs less?)
(reduce (lambda (e acc)
diff --git a/algebraic-structures.semigroup.reduce.scm b/algebraic-structures.semigroup.reduce.scm
index f5340e7..72fb831 100644
--- a/algebraic-structures.semigroup.reduce.scm
+++ b/algebraic-structures.semigroup.reduce.scm
@@ -1,4 +1,6 @@
(functor ((algebraic-structures semigroup reduce) (S (<>)) (R (reduce))) (reduce)
- (import scheme S (rename R (reduce reducible:reduce)))
+ (import scheme
+ (only S <>)
+ (rename (only R reduce) (reduce reducible:reduce)))
(define (reduce xs) (reducible:reduce <> xs)))
diff --git a/algebraic-structures.semigroup.scm b/algebraic-structures.semigroup.scm
index 3912349..3c88f12 100644
--- a/algebraic-structures.semigroup.scm
+++ b/algebraic-structures.semigroup.scm
@@ -1,2 +1,2 @@
(functor ((algebraic-structures semigroup) (S (<>))) (<>)
- (import S))
+ (import (only S <>)))