Vavr is a functional library for Java 8+ that provides immutable data types and functional control structures.

Note that functional programming is not only a new set of tools to get accustomed with but also a new paradigm to understand.

So let's jump into it.

Vavr Basics

Vavr Advanced

Generic bottom

I just announced the new Learn Spring course, focused on the fundamentals of Spring 5 and Spring Boot 2:

Newest Most Voted
Inline Feedbacks
View all comments
3 years ago

The only downside I see for now is, if we use Java collections classes in our code along with this library, which is quite expected, the code becomes more verbose with respect to type declarations.
Or I could be missing something.

For eg.,
io.vavr.collection.Map<String, io.vavr.collection.List> evenOddGroup =
io.vavr.collection.List.of(1, 2, 3, 4, 5).groupBy(i -> i % 2 == 0 ? “Even” : “Odd”);

Grzegorz Piwowarek
3 years ago
Reply to  Jagannath

Well, if you have colliding names, there is no other way to go, the good news is that Vavr is planning to change names of their collections in the future (add a short prefix to all of them), in order to avoid this kind of problems

Comments are closed on this article!