aboutsummaryrefslogtreecommitdiff
path: root/algebraic-structures.functor.vector.base.scm
diff options
context:
space:
mode:
Diffstat (limited to 'algebraic-structures.functor.vector.base.scm')
-rw-r--r--algebraic-structures.functor.vector.base.scm10
1 files changed, 10 insertions, 0 deletions
diff --git a/algebraic-structures.functor.vector.base.scm b/algebraic-structures.functor.vector.base.scm
new file mode 100644
index 0000000..2f44673
--- /dev/null
+++ b/algebraic-structures.functor.vector.base.scm
@@ -0,0 +1,10 @@
+(module (algebraic-structs functor vector base) (map)
+ (import (rename scheme (map list-map))
+ (only (chicken base) add1))
+
+ (define (map f v)
+ (let* ((len (vector-length v))
+ (new (make-vector len)))
+ (do ((i 0 (add1 i)))
+ ((= i len) new)
+ (vector-set! new i (vector-ref v i))))))