Tips of Functional Programing in Java(Java函数式编程)

下面是我总结的一些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

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 夜莺2517阅读 127,761评论 1 9
  • 版本:ios 1.2.1 亮点: 1.app角标可以实时更新天气温度或选择空气质量,建议处女座就不要选了,不然老想...
    我就是沉沉阅读 6,966评论 1 6
  • 我是一名过去式的高三狗,很可悲,在这三年里我没有恋爱,看着同龄的小伙伴们一对儿一对儿的,我的心不好受。怎么说呢,高...
    小娘纸阅读 3,417评论 4 7
  • 这些日子就像是一天一天在倒计时 一想到他走了 心里就是说不出的滋味 从几个月前认识他开始 就意识到终究会发生的 只...
    栗子a阅读 1,646评论 1 3