Tips of Functional Programing in Java
There are only some concepts, details should google yourself.
- What is Functional Programing?
- In mathematics, function is an expression that relates an input set to an output set.
-
Functional programming
is a style of writing computer programs that treat computations as evaluating mathematical functions.
- Lambda Calculus
-
Lambda calculus
is a universal model, a formal system to express computations based on functional abstraction. - Tremendous impact : functional programing languages implements lambda calculus.
-
- Concepts of functional programing
- First-Class and High-Order functions
- Pure functions
- Immutability
- Referential transparency
- Functional programing techniques
- Composition : compose(), andThen()
-
Monads :
- a
monad
allows us to wrap a value, apply a set of transformations, and get the value back with all transformations applied。 - such as : optional、stream、future etc, those have flatMap() method we call monad.
- a
-
Currying
- Currying is a mathematical technique of converting a function that takes multiple arguments into a sequence of functions that take a single argument.
- depends on : lambda expression and closures.
- closures : Java has a limitation that variables the enclosing scope have to be final or effectively final.
- Recursion
In additions, I'm a funny photographer, welcome to fellow my ins: leavestylephoto
Top comments (0)