大纲 Functional Language and MapReduce ■MapReduce Basic MapReduce Algorithm Design Hadoop and Java Practice 2
2 大纲 ◼ Functional Language and MapReduce ◼ MapReduce Basic ◼ MapReduce Algorithm Design ◼ Hadoop and Java Practice
NC&IS Functional Language and MapReduce
Functional Language and MapReduce
What is Functional Programming? In computer science,functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data.It emphasizes the application of functions,in contrast with the imperative programming style that emphasizes changes in state.[1] 4
4 What is Functional Programming? ◼ In computer science, functional programming is a programming paradigm that treats computation as the evaluation of mathematical functions and avoids state and mutable data. It emphasizes the application of functions, in contrast with the imperative programming style that emphasizes changes in state.[1]
Example Summing the integers 1 to 10 in Java: total =0; for(i=1;i≤10;++1) total total+i; The computation method is variable assignment. 5 5
5 Example Summing the integers 1 to 10 in Java: total = 0; for (i = 1; i 10; ++i) total = total+i; The computation method is variable assignment. 5
Example Summing the integers 1 to 10 in Haskell: sum[1..10] The computation method is function application. 6 6
6 Example Summing the integers 1 to 10 in Haskell: sum [1..10] The computation method is function application. 6