Presentation is loading. Please wait.

Presentation is loading. Please wait.

Second Order Programming Intro2CS – week 10B 1. Functions are values too 2.

Similar presentations


Presentation on theme: "Second Order Programming Intro2CS – week 10B 1. Functions are values too 2."— Presentation transcript:

1 Second Order Programming Intro2CS – week 10B 1

2 Functions are values too 2

3 3

4 4

5 Functions can be parameters 5

6 Same Thing… 6

7 Polymorphism 7

8 Lambda notation 8 Function ofThat returns

9 Using Lambda’s 9

10 Map 10

11 Filter 11

12 Reduce 12

13 Python’s map, filter, and reduce 13

14 Hadoop (Map-Reduce) Leading simple paradigm for parallel programming – Mapping of the elements can be done in parallel – Reduction can also (partially) be done in parallel -- if op is associative – If a partial result is lost due to hardware failure, only the missing result needs to be re-computed 1 + 2 + 3 + 4 + 5 + 6 14

15 Web Search Example 15

16 Web Search Example (cont.) 16

17 Test Run 17

18 Intermediate Prints 18

19 Returning functions 19

20 Closure 20

21 Currying 21

22 Functions of functions 22

23 Iterated functions 23

24 Memoization 24

25 Python Decorators 25

26 Logging 26


Download ppt "Second Order Programming Intro2CS – week 10B 1. Functions are values too 2."

Similar presentations


Ads by Google