Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Fold

Name: Anonymous 2008-02-02 15:04

http://www.haskell.org/haskellwiki/Fold
Haskell has map in terms of 'foldr ((:) . f) []'

How would you implementd foldr, and then map with foldr in scheme/lisp?

Name: Anonymous 2008-02-02 15:36

(define (map f seq)
  (foldr (lambda (x y) (cons (f x) y)) '() seq))

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List