;;; $Id: list-map-mod.scm,v 1.1 2006/01/04 07:42:11 leavens Exp $ ;;; AUTHOR: Brian Dorn and Gary T. Leavens (module list-map-mod (lib "typedscm.ss" "typedscm") (provide list-map) (deftype list-map (forall (s t) (-> ((-> (s) t) (list-of s)) (list-of t)))) (define list-map (lambda (f l) ;; ENSURES: Result is a list of the results of applying f to ;; each element of l. (cond ((null? l) '()) (else (cons (f (car l)) (list-map f (cdr l))))))) ) ;; end module