anchor.diff:              (filter p (cdr xs) acc))]))
   
   (defun any (p xs)
  -  "Test for the existence of any element in XS matching the predicate P."
  +  "Check for the existence of an element in XS that matches the
  +   predicate P.
  +   
  +   Example:
  +   ```
  +   > (any exists? '(nil 1 \"foo\"))
  +   true
  +   ```"
     (assert-type! p function)
     (assert-type! xs list)
  -  (foldr (lambda (x y) (or x y)) false (map p xs)))
  +  (accumulate-with p -or false xs))
   
   (defun all (p xs)
  -  "Test if all elements of XS match the predicate P."
  +  "Test if all elements of XS match the predicate P.
  +  
  +   Example:
  +   ```
  +   > (all symbol? '(foo bar baz))
  +   true
  +   > (all number? '(1 2 foo))
  +   false
  +   ```"
     (assert-type! p function)
     (assert-type! xs list)
  -  (foldr (lambda (x y) (and x y)) true (map p xs)))
  +  (accumulate-with p -and true xs))
   
   (defun elem? (x xs)
  -  "Test if X is present in the list XS."
  +  "Test if X is present in the list XS.
  +  
  +   Example:
  +   ```
  +   > (elem? 1 '(1 2 3))
  +   true
  +   > (elem? 'foo '(1 2 3))
  +   false
  +   ```"
     (assert-type! xs list)
     (any (lambda (y) (= x y)) xs))
   
   (defun prune (xs)
  -  "Remove values matching the predicate [[nil?]] from the list XS"
  +  "Remove values matching the predicate [[nil?]] from the list XS.
  +
  +   Example:
  +   ```
  +   > (prune '(() 1 () 2))
  +   '(1 2)
  +   ```"
     (assert-type! xs list)
     (filter (lambda (x) (! (nil? x))) xs))
   
   (defun traverse (xs f)
  -  "An alias for [[map]] with the arguments XS and F flipped."
  +  "An alias for [[map]] with the arguments XS and F flipped.
  +
  +   Example:
  +   ```
  +   > (traverse '(1 2 3) succ)
  +   '(2 3 4)
  +   ```"
     (map f xs))
   
   (defun last (xs)
  -  "Return the last element of the list XS. (Counterintutively, this function runs in constant time)."
  +  "Return the last element of the list XS.
  +   Counterintutively, this function runs in constant time.
  +
  +   Example:
  +   ```
  +   > (last (range 1 100))
  +   100
  +   ```"
     (assert-type! xs list)
     (get-idx xs (# xs)))
   
   (defun nth (xs idx)
  -  "Get the IDX th element in the list XS. The first element is 1."
  +  "Get the IDX th element in the list XS. The first element is 1.
  +   This function runs in constant time.
  +
  +   Example:
  +   ```
  +   > (nth (range 1 100) 10)
  +   10
  +   ```"
     (get-idx xs idx))
   
   (defun push-cdr! (xs val)
  -  "Mutate the list XS, adding VAL to its end."
  +  "Mutate the list XS, adding VAL to its end.
  +
  +   Example:
  +   ```
  +   > (define list '(1 2 3))
  +   > (push-cdr! list 4)
  +   '(1 2 3 4)
  +   > list
  +   '(1 2 3 4)
  +   ```"
     (assert-type! xs list)
     (let* [(len (+ (# xs) 1))]
       (set-idx! xs "n" len)
  
positive.code: (import base (defun defmacro when let* set-idx!
                get-idx and cons for gensym
                pretty print error tostring or
                unpack debug if # + - >= = ! with))
  (import base)
  (import lua/table)
  (import type (list? nil? assert-type! exists? falsey?))
  
  (defun car (x)
    "Return the first element of the array X"
    (assert-type! x list)
    (base/car x))
  
  (defun cdr (x)
    "Drop the first element of the array X, and return the rest."
    (assert-type! x list)
    (if (nil? x)
      '()
      (base/cdr x)))
  
  (defun snoc (xs x)
    "Add the element X to the end of the list XS."
    `(,@xs ,x))
  
  (defun foldr (f z xs)
    "Fold over the list XS using the binary operator F and the starting value Z."
    (assert-type! f function)
    (assert-type! xs list)
    (cond
      [(nil? xs) z]
      [true (let* [(head (car xs))
                   (tail (cdr xs))]
              (f head (foldr f z tail)))]))
  
  (defun map (f xs acc)
    "Map over the list XS using the unary function F. The parameter ACC
     is for internal use only."
    (assert-type! f function)
    (assert-type! xs list)
    (cond
  
negative.code:   "Iterate over all the successive cars of XSS, producing a single list
     by applying FN to all of them. For example:
  
     Example:
     ```
     > (zip list '(1 2 3) '(4 5 6) '(7 8 9))
     '((1 4 7) (2 5 8) (3 6 9))
  