20 likes | 162 Vues
In this engaging lecture, we delve into advanced Higher Order Functions (HOFs) and their practical applications in computing. Covering topics such as the map and reduce functions, along with the creation of new lists based on predicates, this session offers insights into functional programming techniques. We'll explore various examples and scripts to illustrate how these concepts can be applied in real-world scenarios. Join us to unlock the beauty and joy of computing through the power of higher order functions!
E N D
CS10 : The Beauty and Joy of ComputingLecture #20Higher Order Functions II 2012-07-24 Yes Project Proposal! Yes Blog Post! UC Berkeley EECSSummer InstructorBen Chun No Reading Quiz! You can take CS188 (AI) or CS169 (Software as a Service) on BerkeleyX in the Fall, along with courses from MIT and Harvard. This is the not-for-profit competition to Udacity, Coursera, etc. and it is well-funded. Over 150k people signed up for the first MITx course last spring! UC Berkeley Joins edx http://www.edx.org/
Today • Review useful HOFs • map Reporter over List • Report a new list, every element E of Listbecoming Reporter(E) • keep items such that Predicate from List • Report a new list, keeping only elements Eof List if Predicate(E) • combine with Reporter over List • Combine all the elements of List with Reporter(E) • This is also known as “reduce” • Acronym example • keep map combine • The script, run and launch • For each • Compose example