(require "logic.BRU" "lists.BRU" "numbers.BRU" "pairs.BRU") [(map-impl (\map (\callback (\list (if (null? list) nil (cons (callback (head list)) (map callback (rest list)))))))) (fold-impl (\fold (\base-case-value (\combiner (\ls (if (null? ls) base-case-value (combiner (head ls) (fold base-case-value combiner (rest ls))))))))) ;(define sum (fold 0 +)) ;(define product (fold 1 ∙)) (length-impl (\length (\list (if (null? list) 0 (succ (length (rest list))))))) (zip-impl (\zip (\l1 (\l2 (if (null? l1) nil (cons (pair (head l1) (head l2)) (zip (rest l1) (rest l2))))))))]