Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is monad analog in Java?

I know in Scala and many other functional languages there are monads that is mostly just an interface realization(for example in Scala with flatMap[T] and unit[T] methods) is there are any Java-style interfaces that could be a monad?

like image 251
Stepango Avatar asked May 15 '15 06:05

Stepango


1 Answers

No, because monad interface requires so-called higher-kinded types which don't exist in Java. Of course, you can implement many (not all) specific monads in Java.

like image 147
Alexey Romanov Avatar answered Sep 23 '22 11:09

Alexey Romanov