CS115 Lecture Notes - Lecture 9: Long Term Ecological Research Network

82 views2 pages
elliehaj0807 and 36989 others unlocked
CS115 Full Course Notes
13
CS115 Full Course Notes
Verified Note
13 documents

Document Summary

1 parameter consumes type a and produces bool (pred) 1 parameter consumes type a produces type any. A list of type a a list of type a. The length of the produced list is equal to or smaller than the consumed one. A list of type a a list of type any. The length of the produced list is equal to the consumed one ( lter even? (list 1 2 3 4 5)) => (list 2 4) (map even? (list 1 2 3 4 5)) => (list false true false true false) foldr. Implementation of folder (de ne (foldr combine base alst) (cond. [else (combine ( rst aslt) (foldr combine base (rest alst)))])) combine function: consumes 2 parameters (one is type a, the other is type b) and produces type b base: type b alst: list of type a. Examples: (foldr + 0 (list 1 2 3)) => 6 (foldr * 1 (list 1 2 3))

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents

Related Questions