Hi Abhinava, I'm glad someone's writing about Java and FP. Doesn't seem to be a popular combination on dev.to ...or anywhere. 🤣
I've only started to work again with Java recently and couldn't find much besides streams that I can use for FP in Java. So my programs are still very OO-ish, and I can only make use of streams in some methods. But what about enforcing immutability? What about currying? And monads? I know there are libraries like vavr.io that implement these things for Java, but I haven't touched them, yet. Do you know such libraries? I'm afraid there might be a heavy performance impact when using such libraries.
I'm Abhinava Ghosh, a Computer Science and Engineering Student who is passionate about simplifying things through technology. I work with all kinds of modern Java,Android and JavaScript Applications.
Using FP in monads for example is not very common , and as far as i have experienced Streams are the only widespread use of FP in JAVA currently.And its not bcoz of performance issues but bcoz there are better alternatives to it.
Most you can get from Vavr is some mix of OOP and FP and it works great. It's probably the best FPish library for Java. Pure FP is not possible in Java, like in Scala with ZIO, Cats-Effect, and Monix.
I wrote a blog about FP in Java and Vavr, if you are interested here is the link: aleksandarskrbic.github.io/a-taste...
Some comments have been hidden by the post's author - find out more
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Hi Abhinava, I'm glad someone's writing about Java and FP. Doesn't seem to be a popular combination on dev.to ...or anywhere. 🤣
I've only started to work again with Java recently and couldn't find much besides streams that I can use for FP in Java. So my programs are still very OO-ish, and I can only make use of streams in some methods. But what about enforcing immutability? What about currying? And monads? I know there are libraries like vavr.io that implement these things for Java, but I haven't touched them, yet. Do you know such libraries? I'm afraid there might be a heavy performance impact when using such libraries.
Using FP in monads for example is not very common , and as far as i have experienced Streams are the only widespread use of FP in JAVA currently.And its not bcoz of performance issues but bcoz there are better alternatives to it.
Most you can get from Vavr is some mix of OOP and FP and it works great. It's probably the best FPish library for Java. Pure FP is not possible in Java, like in Scala with ZIO, Cats-Effect, and Monix.
I wrote a blog about FP in Java and Vavr, if you are interested here is the link: aleksandarskrbic.github.io/a-taste...