美文网首页
Tips of Functional Programing in

Tips of Functional Programing in

作者: LeaveStyle | 来源:发表于2021-02-09 19:14 被阅读0次

下面是我总结的一些Java中函数式编程的要点,欢迎提问:

  1. 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.
  2. 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.
  3. Concepts of functional programing
    3.1. First-Class and High-Order functions
    3.2. Pure functions
    3.3. Immutability
    3.4. Referential transparency

  4. Functional programing techniques
    4.1. Composition : compose(), andThen()
    4.2. 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.
    4.3. Currying : 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.
    4.4. Recursion

相关文章

网友评论

      本文标题:Tips of Functional Programing in

      本文链接:https://www.haomeiwen.com/subject/bfucxltx.html