SLIDE 1
Functional Programming In Java Alonzo Church Lambda calculus - - PowerPoint PPT Presentation
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
SLIDE 2
SLIDE 3
(λx.x²)
x -> x * x int powerOf2 (int x){ return x*x; }
SLIDE 4
Predicate
Is a function that returns true or false. x -> x == 2
SLIDE 5
Haskell Curry
Combinatory logic
SLIDE 6
What is FP?
Pure Functions Higher order Functions Lazy Evaluation Closure Currying
SLIDE 7
f(x) == f(x)
A pure function has no side effects.
SLIDE 8
What is FP?
Pure Functions Higher order Functions Lazy Evaluation Closure Currying
SLIDE 9
Functions can be treated like data
SLIDE 10
Functions can be treated like data
SLIDE 11
What is FP?
Pure Functions Higher order Functions Lazy Evaluation Closure Currying
SLIDE 12
Delays the evaluation until the value is needed
SLIDE 13
What is FP?
Pure Functions Higher order Functions Lazy Evaluation Closure Currying
SLIDE 14
Close but no cigar
A Closure is a function with a reference to the state of the function returning it.
SLIDE 15
What is FP?
Pure Functions Higher order Functions Lazy Evaluation Closure Currying
SLIDE 16
Chain the parameters! Chain them all!
SLIDE 17
What is FP not?
A replacement for OOP The solution to all your problems Free performance gain
SLIDE 18
The advantages of FP
No side effects Stateless Concurrency and (true) parallelisation Lesser rituals, therefore easier to read and maintain Code is easier to reuse
SLIDE 19
The Future
Multithread Multicore Multi CPU Cluster APU GPU (Crossfire / SLI) FPGA (field-programmable gate array)
SLIDE 20