Monads with Java 8

前端 未结 9 1058
礼貌的吻别
礼貌的吻别 2020-12-07 07:29

In the interests of helping to understand what a monad is, can someone provide an example using java ? Are they possible ?

Lambda expressions are possible using java

9条回答
  •  不思量自难忘°
    2020-12-07 08:25

    This blog post gives a step-by-step example of how you might implement a Monad type (interface) in Java and then use it to define the Maybe monad, as a practical application.

    This post explains that there is one monad built into the Java language, emphasising the point that monads are more common than many programmers may think and that coders often inadvertently reinvent them.

提交回复
热议问题