aboutsummaryrefslogtreecommitdiff
path: root/algebraic-structures.private.list.scm
blob: a5bb6f46c0d3d32be57efb4bc1e8eb3cea5947a2 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
(module (algebraic-structures private list) (op unit fold reduce map1)
  (import scheme
          (rename (only (srfi 1) fold reduce)
                  (fold srfi:fold)
                  (reduce srfi:reduce))
          (only (chicken base) assert))

  (define op append)

  (define unit '())

  (define fold srfi:fold)

  (define (reduce f xs)
    (assert (not (null? xs)))
    (srfi:reduce f #f xs))

  (define (map1 f xs)
    (map f xs)))