vavr
vavr copied to clipboard
vʌvr (formerly called Javaslang) is a non-commercial, non-profit object-functional library that runs with Java 8+. It aims to reduce the lines of code and increase code quality.
Tuples are missing a method that would return nothing, `void`. The method signature would be `void tap(Closure /*will all tuple elements as input arg*/)`. The use case is when you...
I notice that `Collections.groupBy()` creates a `LinkedHashMap`, which preserves insertion order when classifying items by their new key. Is this intended to be guaranteed or is it merely an accident...
I would like to collect a stream of objects into a map, while dealing with duplicate keys analogous to the Java collector `Collectors::toMap(Function, Function, BinaryOperator)`. Is there a canonical way...
Related Epic: https://github.com/vavr-io/vavr/issues/2308 CompressedHAMP is designed to provide a smaller footprint and better cache locality than standard HAMT which features one array encoding both sub-node references and data values. To...
I need in my code to distinguish LinkedMap and Map as a field declaration, and function parameter. Using LInkedHashMap is inconvenient, because required always to cast result of Value.toLinkedMap(...) method...
Hey everyone! Considering JDK17 is a LTS version and the sealed class feature being production ready with its release, are there any plans regarding using this feature for defining parametric...
There was some prior discussion about safety. A Java dev isn’t expecting a checked exception to be sneaky thrown, especially if it isn’t declared on the method signature. Sneaky throw...
This prevents the following gradle warning: ``` Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0. You can use '--warning-mode all' to show the individual...
My apologies if you've already discussed this to death; just let me know. I ran into this today. ``` var fallback = ...; myOption.fold(fallback::g, null); ``` I was in a...
Example: ``` @Test public void shouldApplyThrowingCheckedConsumer() { final CheckedConsumer f = t -> { throw new Error(); }; try { f.accept(null); fail("should have thrown"); } catch(Throwable x) { // ok...