functional programming
play

Functional Programming In Java Alonzo Church Lambda calculus - PowerPoint PPT Presentation

Functional Programming In Java Alonzo Church Lambda calculus (1930) ( x.x ) x -> x * x int powerOf2 (int x){ return x*x; } Predicate Is a function that returns true or false . x -> x == 2 Haskell Curry Combinatory logic


  1. Functional Programming In Java

  2. Alonzo Church Lambda calculus (1930)

  3. 
 ( λ x.x ² ) x -> x * x int powerOf2 (int x){ return x*x; }

  4. Predicate Is a function that returns true or false . x -> x == 2

  5. Haskell Curry Combinatory logic

  6. What is FP ? Pure Functions Higher order Functions Lazy Evaluation Closure Currying

  7. f(x) == f(x) A pure function has no side effects.

  8. What is FP ? Pure Functions Higher order Functions Lazy Evaluation Closure Currying

  9. Functions can be treated like data

  10. Functions can be treated like data

  11. What is FP ? Pure Functions Higher order Functions Lazy Evaluation Closure Currying

  12. Delays the evaluation until the value is needed

  13. What is FP ? Pure Functions Higher order Functions Lazy Evaluation Closure Currying

  14. Close but no cigar A Closure is a function with a reference to the state of the function returning it.

  15. What is FP ? Pure Functions Higher order Functions Lazy Evaluation Closure Currying

  16. Chain the parameters! 
 Chain them all!

  17. What is FP not? A replacement for OOP The solution to all your problems Free performance gain

  18. The advantages of FP No side e ff ects Stateless Concurrency and (true) parallelisation Lesser rituals , therefore easier to read and maintain Code is easier to reuse

  19. The Future Multithread Multicore Multi CPU Cluster APU GPU (Crossfire / SLI) FPGA (field-programmable gate array)

Recommend


More recommend