All Versions
10
Latest Version
Avg Release Cycle
156 days
Latest Release
1738 days ago

Changelog History

  • v1.0.0 Changes

    July 23, 2019

    Info

    Caution: This is a preview release of the upcoming major release 1.0.0. It is highly under development and the API is subject to change. Please do not use it in production.

    We are still in the process of moving the changes from the original 1.0.0 branch to master.

    βž• Additionally there are stashed changes that did not make it into the minor release 0.10.0, that may make it into the upcoming 1.0.0 release. This is also work in progress.

    πŸ“„ The API Docs can be found here (🚧 currently unavailable because https://www.javadoc.io seems to be down)

    Comitters

    🍱 πŸŽ‰ MANY THANKS TO ALL COMMITTERS! πŸŽ‰

    • 🍱 ⭐️ Daniel Dietrich (@danieldietrich)
    • 🍱 ⭐️ baant
    • 🍱 ⭐️ Alexandru Stana (alexandrustana)
    • 🍱 ⭐️ Mark Raynsford (io7m)
    • 🍱 ⭐️ Theodor A. Dumitrescu (@thadumi)
    • 🍱 ⭐️ Juan Antonio BreΓ±a Moral (jabrena)
    • 🍱 ⭐️ Bram Schuur (@craffit)
    • 🍱 ⭐️ Mincong Huang (mincong-h)

    πŸ”„ Changes

    Please find the complete list of changes here.

  • v1.0.0-alpha Changes

    July 23, 2019

    Info

    Caution: This is a preview release of the upcoming major release 1.0.0. It is highly under development and the API is subject to change. Please do not use it in production.

    We are still in the process of moving the changes from the original 1.0.0 branch to master.

    βž• Additionally there are stashed changes that did not make it into the minor release 0.10.0, that may make it into the upcoming 1.0.0 release. This is also work in progress.

    πŸ“„ The API Docs can be found here (🚧 currently unavailable because https://www.javadoc.io seems to be down)

    Comitters

    🍱 πŸŽ‰ MANY THANKS TO ALL COMMITTERS! πŸŽ‰

    • 🍱 ⭐️ Daniel Dietrich (@danieldietrich)
    • 🍱 ⭐️ baant
    • 🍱 ⭐️ Alexandru Stana (alexandrustana)
    • 🍱 ⭐️ Mark Raynsford (io7m)
    • 🍱 ⭐️ Theodor A. Dumitrescu (@thadumi)
    • 🍱 ⭐️ Juan Antonio BreΓ±a Moral (jabrena)
    • 🍱 ⭐️ Bram Schuur (@craffit)
    • 🍱 ⭐️ Mincong Huang (mincong-h)

    πŸ”„ Changes

    Please find the complete list of changes here.

  • v0.10.3 Changes

    May 15, 2020

    Info

    πŸš€ This is a maintenance release for the 0.10.x release train.

    Please find the complete list of changes here.

    πŸ“„ The API Docs can be found here

    Committers

    🍱 πŸŽ‰ MANY THANKS TO ALL COMMITTERS! πŸŽ‰

    πŸ”„ Changes

    • πŸ›  Bugfix: #2583 Backport: Re-adds the automatic module name
    • πŸ‘Œ Improvement: #2575 Backport "Avoid unnecessary copy in 'ofAll()' methods" to v0.10
    • πŸ“š Documentation: #2587 Bumps the copyright year to 2020
  • v0.10.2 Changes

    August 02, 2019

    πŸš€ This patch release fixes the bug of overlapping JPMS module names by removing the Automatic-Module-Name attributes from the MANIFEST.MF files.

    πŸš€ The upcoming release v1.0.0 will not have Automatic-Module-Name attributes.

    πŸš€ The next release v2.0.0 will have proper JPMS modules.

  • v0.10.1 Changes

    July 23, 2019

    Info

    πŸš€ This is a maintenance release for the 0.10.x release train.

    Please find the complete list of changes here.

    πŸ“„ The API Docs can be found here (🚧 currently unavailable because https://www.javadoc.io seems to be down)

    Comitters

    🍱 πŸŽ‰ MANY THANKS TO ALL COMMITTERS! πŸŽ‰

    • 🍱 ⭐️ Daniel Dietrich (@danieldietrich)
    • 🍱 ⭐️ Theodor A. Dumitrescu (@thadumi)
    • 🍱 ⭐️ Bram Schuur (@craffit)

    πŸ”„ Changes

    • πŸ›  Bugfix: #2430 Future.reduce considers executor
    • πŸ›  Bugfix: #2426 Fixes DistictIterator to not eat null values
    • πŸ›  Bugfix: #2405 Fixes patmat corner case that might produce a ClassCastException
    • πŸ›  Bugfix: #2403 ClassCastException during pattern matching
    • πŸ›  Bugfix: #2399 Fix: CharSeq implements Comparable
    • πŸ‘Œ Improvement: #2400 Improve performance of last() call on TreeMap
  • v0.10.0 Changes

    January 20, 2019

    Info

    πŸš€ The minor release 0.10.0 focuses on several API improvements.

    Please find the complete list of changes here.

    πŸ“„ The API Docs can be found here

    Comitters

    🍱 πŸŽ‰ MANY THANKS TO ALL COMMITTERS (AND THEIR PATIENCE)! πŸŽ‰

    Note: A few contributions didn't made it into 0.10.0 because of backward incompatibilities.

    πŸ”„ Changes

    Instead of describing all changes in detail, I will provide a list and show some examples.
    Beside new features there were also several (internal) improvements not shown here.

    Core/API

    for

    • πŸ”„ Change (internal): Removed internal interface io.vavr.Lambda which was on top of the (Checked)Function type hierarchy. It was not public.
    • πŸ”‹ Feature: For-comprehension supports List, Option, Future, Try
    • πŸ”‹ Feature: Tuple - append(), concat() and hash()
    • πŸ”‹ Feature: CheckedConsumer, CheckedPredicate and CheckedRunnable enhancements
    • πŸ”‹ Feature: PartialFunction now implements Function1
    • πŸ”‹ Feature: Predicates.not()
    • πŸ”‹ Feature: Value: toJavaArray(IntFunction), toTree(Function, Function)
    • πŸ—„ Deprecation (for removal): API.Map(Tuple2)
    • πŸ—„ Deprecation (for removal): API.LinkedMap(Tuple2)
    • πŸ—„ Deprecation (for removal): API.SortedMap(Tuple2)
    • πŸ—„ Deprecation (for removal): API.SortedMap(Comparator, Tuple2)
    • πŸ—„ Deprecation (for removal): API.SortedMap(java.util.Map)
    • πŸ—„ Deprecation (for removal): Value.toLeft()
    • πŸ—„ Deprecation (for removal): Value.toRight()
    • πŸ—„ Deprecation (for removal): Value.toValid()
    • πŸ—„ Deprecation (for removal): Value.toInvalid()

    Collections

    for-each-with-index

    • πŸ”‹ Feature: Traversable: forEachWithIndex, reject(Predicate)
    • πŸ”‹ Feature: Iterator/Stream: fill(int, Object)
    • πŸ”‹ Feature: Map/Multimap: reject(BiPredicate), rejectKeys(Predicate), rejectValues(Predicate), keysIterator(), valuesIterator()
    • πŸ”‹ Feature: Map/Seq: asPartialFunction()
    • πŸ”‹ Feature: Seq.rotateLeft, rotateRight, takeRight, takeRightUntil, takeRightWhile

    Concurrent

    future

    • πŸ”„ Change: Future now uses Executor instead of ExecutorService. The executorService() works as before if Future was initialized with an ExecutorService, otherwise it throws. User executor() instead.
    • πŸ”„ Change: Future DEFAULT_EXECUTOR: ForkJoinPool.commonPool()
    • πŸ”‹ Feature: Future.await(long timeout, TimeUnit unit)
    • πŸ”‹ Feature: Future.isCancelled()
    • πŸ”‹ Feature (experimental): (Experimental) Future.run(Task), Future.run(Executor, Task)
    • πŸ—„ Deprecation (for removal): Seq/Map/Set withDefault, withDefaultValue

    Controls

    try-fold

    • πŸ”‹ Feature: Either.sequence, Either.sequenceRight
    • πŸ”‹ Feature: Either.traverse, Either.traverseRight
    • πŸ”‹ Feature: Either.filterOrElse
    • πŸ”‹ Feature: Either.toValidation
    • πŸ”‹ Feature: Option.traverse
    • πŸ”‹ Feature: Option.fold
    • πŸ”‹ Feature: Try.traverse
    • πŸ”‹ Feature: Try.onFailure
    • πŸ”‹ Feature: Try.fold
    • πŸ”‹ Feature: Try.toValidation
    • πŸ”‹ Feature: Validation.fromTry
    • πŸ”‹ Feature: Validation.traverse
    • πŸ—„ Deprecation (for removal): Either.left(), Either.right()
    • πŸ—„ Deprecation (for removal): Either.LeftProjection, Either.RightProjection
  • v0.9.3 Changes

    January 07, 2019

    Info

    πŸš€ The release increases stability and performance.

    Please find the complete list of changes here.

    πŸ“„ The API Docs can be found here

    Comitters

    πŸš€ πŸŽ‰ MANY THANKS TO ALL COMMITTERS THAT MADE THIS RELEASE POSSIBLE πŸŽ‰

    πŸ› Bug fixes

    🍱 🚨 LinkedHashMap duplicate entries

    In Vavr 0.9.2, all LinkedHashMap factory methods internally did not store keys and values correctly.

    Example:

    var map = LinkedHashMap(1, "1", 1, "2", 2, "3", 2, "4");// = 2 (CORRECT)map.size();// = LinkedHashSet(1, 1, 2, 2) (WRONG)// = LinkedHashSet(1, 2) (FIXED)map.keySet() = LinkedHashSet(1, 1, 2, 2)// = List("1", "2", "3", "4") (WRONG)// = List("2", "4") (FIXED)map.values() = List(1, 2, 3, 4)
    

    Details can be found here.

    🍱 🚨 TreeSet fell back to natural comparator after removing all elements

    // = TreeSet(2, 1)var set1 = TreeSet.ofAll(Comparator.reverseOrder(), List(1, 1, 2, 2));// = TreeSet() has now natural comparator (WRONG)// = TreeSet() keeps reverse order (FIXED)var set2 = set1.removeAll();// = TreeSet(1, 2) (WRONG)// = TreeSet(2, 1) (FIXED)set2.addAll(List(1, 1, 2, 2));
    

    Details can be found here.

    🍱 🚨 Stream flatMap memory consumption

    Stream.flatMap used an inner class for iteration, with the effect of the result stream holding an unnecessary indirect reference to the head of the source stream, resulting in a "temporary" memory leak.

    However, when the reference to the original Stream was garbage-collected, the memory was completely freed.

    Details can be found here.

    🐎 Performance improvements

    🍱 🏁 Hash code calculation

    Internally, we relied on

    Objects.hash(T... varargs)
    

    for hashCode calculation. A call

    Objects.hash(1, 2, 3)
    

    results in an array creation. In order to prevent that unnecessary instance creation, we added internal methods that preserve our hash semantics.

    🍱 🏁 Micro-optimizations of collections

    We did some micro-optimizations to

    • CharSeq.ofAll(Iterable)
    • CharSeq.prependAll(Iterable)
    • Vector.ofAll(Iterable)
    • Vector.appendAll(Iterable)
    • Vector.prependAll(Iterable)

    Low-level details can be found here.

    πŸ†• New API

    🍱 πŸŽ‰ Map additions

    πŸš€ We follow the Semantic Versioning scheme. Although this release is a patch release, there are two new methods:

    I hope, your OSGi infrastructure does not complain about it.

    Jar files

    πŸ“¦ πŸ“¦ Separate annotation processor jar

    We separated annotation vavr-match-processor-<version>.jar from vavr-match-<version>.jar.

    If you want to create your own pattern matching patterns, you need to include these two dependencies now instead of only vavr-match.

    πŸ“š Documentation

    🍱 πŸ“š Javadoc improvements

    • We clarified that LinkedHashMap.put(K, V) and LinkedHashMap.add(T) have a worst-case linear complexity. This is because equal elements need to be replaced while preserving their position.
    • πŸ›  Several small improvements and fixes

    Other improvements

    • πŸ‘Œ Improved interoperability with the GWT compiler
    • Improved Eclipse integration for Vavr committers
  • v0.9.2 Changes

    November 24, 2017

    Contributors

    Daniel Dietrich
    Erlend Hamnaberg
    Michael Ummels
    Pap LΕ‘rinc
    Robert Erdin
    Valeriy Vyrva

    πŸ”„ Changelog

    Works fine on JDK 9

    πŸš€ Vavr 0.9.2 now works fine on JDK 9. The previous release 0.9.1 had an internal dependency that broke the JDK 9 build - we fixed that.

    Note: JDK 9 introduced a type inference bug that may affect Vavr's pattern matching in some cases. Please see JDK-8039214.

    Collections

    • We fixed the implementation of Multimap.last(). We did not override the default Traversable implementation.
    • We fixed a problem with the intersection of ordered collections that are based on RedBlackTree (such as TreeSet ).

    Concurrent

    • We fixed Future.traverse(ExecutorService, Iterable, Function). The ExecutorService was not taken into account.

    πŸ›  More fixes...

    • Beside the above, we fixed some javadoc typos.

    Please find the complete list of changes here.

  • v0.9.1 Changes

    September 17, 2017

    Contributors

    Christian Bongiorno
    Daniel Dietrich
    Emmanuel Touzery
    Julien Debon
    Nazarii Bardiuk
    Pascal Schumacher
    Ruslan Sennov

    πŸ”„ Changelog

    Concurrent operations

    • πŸ›  We fixed a bug that prevented onFailure actions to be performed when a Future has been cancelled.
    • πŸ‘€ There are known problems with Promise that occur under certain circumstances (see details below). Please note that we did not fix this problem in 0.9.1. We currently work on it in #2093. 0️⃣ The main thread may be blocked forever if we use an operation that blocks on a Future returned by a Promise. We observed this behavior when we used a ForkJoinPool instead of the default CachedThreadPool. Example: // we choose a work-stealing thread pool ExecutorService executor = java.util.concurrent.ForkJoinPool.commonPool(); Future<Object> someFuture = Future.of(executor, () -> longRunningTask());

    // the internal Future of a Promise might deadlock the system if we block on that Future Promise<Object> promise = Promise.make(executor); someFuture.onComplete(promise::complete);

    // the bug only shows up when calling a blocking operation, like get() or isEmpty() Object result = promise.future().get();

    Numeric operations

    • βœ‚ Removed the Traversable.min(), max() overloads TreeSet.min() and TreeSet.max()
    • Made Traversable.average(), sum() and product() more accurate. TreeSet min()/max() TreeSet implements SortedSet, which represents distinct elements that are ordered using a specific Comparator. 0️⃣ By default, Traversable.min() and max() calculate the minimum resp. maximum element in linear time O(n) using the natural element order. However, we used the TreeSet collection characteristic to calculate the min() / max() in constant time O(1). This was wrong for two reasons: The Traversable API spec states that min() and max() are calculated using the natural element order. This has to be the case because of the Liskov substitution principle, see examples below. The minimum of any non-empty collection containing double values is Double.NaN if one or more elements are NaN. But the natural Comparator of Double is defined in the way that NaN >= d for every double d. Example: // = TreeSet(3, 2, 1) Set<Integer> ints = TreeSet.of(Comparator.reverseOrder(), 1, 2, 3);

    // = 3 (before), = 1 (after) ints.min();

    // = 1 (before), = 3 (after) ints.max();

    // = List(1.0, NaN, 3.0) List<Integer> doubles = List.of(1.0, Double.NaN, 3.0);

    // = 1.0 (before), = NaN (after) doubles.min();

    // = NaN (both ok, before and after this change) doubles.max(); Traversable average(), sum() and product() sum() and product() operate on elements of type Number. Now we return a Number according to the input argument or fallback to double. πŸ›  sum() and average() now internally use an improved summation compensation algorithm that fixes problems that occur in standard Java. Example: // = OptionalDouble(0.0) (wrong) j.u.s.DoubleStream.of(1.0, 10e100, 2.0, -10e100).average()

    // = Some(0.75) (correct) List.of(1.0, 10e100, 2.0, -10e100).average()

    Missing methods

    We added

    • Either.sequence(Iterable<? extends Either<? extends L, ? extends R>>)
    • Either.sequenceRight(Iterable<? extends Either<? extends L, ? extends R>>) Examples: // = Right(List(all, right)) of type Either<Seq<Integer>, Seq<String>> Either.sequence(List.of(Either.right("all"), Either.right("right")));

    // = Left(List(1, 2)) of type Either<Seq<Integer>, Seq<String>> Either.sequence(List.of(Either.left(1), Either.left(2), Either.right("ok")));

    // = Right(List(all, right)) of type Either<Integer, Seq<String>> Either.sequenceRight(List.of(Either.right("all"), Either.right("right")));

    // = Left(1) of type Either<Integer, Seq<String>> Either.sequenceRight(List.of(Either.left(1), Either.left(2), Either.right("ok")));

    Type narrowing

    We changed the generic bounds of these method arguments:

    • Function0<R>.narrow(Function0<? extends R>) (before: narrow(Supplier<? extends R>))
    • Function1<T1, R> Function1.narrow(Function1<? super T1, ? extends R>) (before: narrow(Function<? super T1, ? extends R>))
    • Function2<T1, T2, R> Function2.narrow(Function2<? super T1, ? super T2, ? extends R>) (before: narrow(BiFunction<? super T1, ? super T2, ? extends R>)) Background: Java is not able to do the following type assignment: M<? extends T> m = ...; M<T> narrowed = m; // does not work but it is correct for immutable objects. Therefore almost all Vavr types have narrow methods. M<? extends T> m = ...; M<T> narrowed = M.narrow(m); // works as expected ### πŸ›  GWT compatibility fixes

    The following methods were annotated with @GwtIncompatible:

    • Predicates#instanceOf(Class)
    • asJava(), asJava(Consumer), asJavaMutable(), asJavaMutable(Consumer) of io.vavr.collection.Seq and all its subtypes,
      namely IndexedSeq, LinearSeq, Array, CharSeq, List, Queue, Stream and Vector

    πŸ“š Documentation

    We added more examples and improved the readability of the Javadoc:

    javadoc

    πŸ’… Thanks to Stuart Marks, he was so kind to initiate an issue in order to improve the default Javadoc style.

    You find the Vavr 0.9.1 API specification here.

    πŸ›  More fixes...

    • 🚚 We removed internal memoization of sortBy() in order to fix an issue with lazy collections that have infinite size
    • ⚑️ We optimized collection conversion
    • πŸ— We fixed the generics of Multimap builders
    • We improved Traversable.reduceLeft
    • We improved Iterator.dropWhile and slideBy

    Please find the complete list of changes here.

  • v0.9.0 Changes

    May 16, 2017

    πŸ”„ Changes to the Base Package io.vavr

    🚚 We removed the interfaces Kind1 and Kind2. They served as bridge for the removed module javaslang-pure, which contained experimental algebraic extensions.

    Values

    • 🚚 We removed getOption() in favor of toOption() (which has the same semantics)
    • We changed the functional interface argument of getOrElseTry(CheckedFunction0) (was: getOrElseTry(Try.CheckedSupplier))
    • 🚚 We removed the conversion method toStack()
    • We replaced the conversion methods
      • toJavaList(Supplier) by toJavaList(Function)
      • toJavaSet(Supplier) by toJavaSet(Function) We added introspection methods isAsync() and isLazy() that provide information about a Value type at runtime We added getOrNull() which returns null if the Value is empty We added Java-like collect() methods We added several conversion methods: toCompletableFuture() toEither(Supplier) toEither(L) toInvalid(Supplier) toInvalid(T) toJavaArray(Class) toJavaCollection(Function) toJavaCollection(Supplier) toJavaList(Function) `toJavaMap(Supplier, Function, Function toJavaParallelStream() toJavaSet(Function) toLinkedMap(Function) toLinkedMap(Function, Function) toLinkedSet() toMap(Function, Function) toPriorityQueue() toPriorityQueue(Comparator) toSortedMap(Comparator, Function) toSortedMap(Comparator, Function, Function) toSortedMap(Function) toSortedMap(Function, Function) toSortedSet() toSortedSet(Comparator) toValid(Supplier) toValid(E) toValidation(Supplier) toValidation(L) ### Functions

    We removed the interface Ξ» (the mother of all functions). It was neat but it had no practical purpose. The unicode character caused several problems with 3rd party tools, which did not handle unicode characters properly.

    • 🚚 We renamed the interface io.vavr.Ξ» to io.vavr.Lambda and removed it from the public API.
    • 🚚 We removed the interface Ξ».Memoized from the public API. We added PartialFunction, which is an enabler for a more performant pattern matching implementation #### Functional interfaces

    With Vavr 0.9 we bundled our functions in io.vavr.

    • 🚚 We moved the functional interfaces Try.CheckedConsumer, Try.CheckedPredicate, Try.CheckedRunnable to io.vavr.
    • We replaced the functional interface Try.CheckedSupplier by the existing CheckedFunction0.

    πŸ‘» Exception Handling

    We added some methods to uncheck an existing throwing function, e.g.CheckedFunction(x -> { throw new Error(); }).unchecked() lift checked functions to an Option return type, e.g.// = NoneCheckedFunction1.lift(x -> { throw new Error(); }).apply(o); lift checked functions to a Try return type, e.g.// = Failure(Error)CheckedFunction1.liftTry(x -> { throw new Error(); }).apply(o);

    Other Factory Methods

    create constant functions, e.g.Function2.constant(1).apply(what, ever); // = 1 narrowing the generic types, e.g. Function0<? extends CharSequence> f_ = () -> "hi"; Function0<CharSequence> f = Function0.narrow(f_);

    Tuples

    • We renamed transform() to apply(), e.g.
      y = f(x1, x2, x3) can be understood as y = Tuple(x1, x2, x3).apply(f). Additions: ⚑️ Tuple fields can be updated using one of the update* methods, e.g.Tuple(1, 2, 3).update2(0). A Tuple2 can be swapped, e.g. Tuple(1, 2).swap(). Tuples can be created from java.util.Map.Entry instances, e.g.Tuple.fromEntry(entry) // = Tuple2 Tuples can be sequenced, e.g.Tuple.sequence1(Iterable<? extends Tuple1<? extends T1>>) // = Tuple1<Seq<T1>> Tuples can be narrowed, e.g.Tuple.narrow(Tuple1<? extends T1>) // = Tuple1<T1> ### The API Gateway

    We added io.vavr.API that gives direct access to most of the Vavr API without additional imports.

    We are now able to start using Vavr by adding one gateway import. More imports can be added on demand by the IDE.

    'Companion' Factory Methods

    import static io.vavr.API.*; The new static factory methods serve two things: They add syntactic sugar. E.g. instead of Try.of(() -> new Error()) we now just write Try(() -> new Error()). They reflect the expected return type. Try<Integer> _try = Try(1); Success<Integer> success = Success(1); Failure<Integer> failure = Failure(new Error());

    Option<Integer> option = Option(1); Some<Integer> some = Some(1); None<Integer> none = None();

    Array<Integer> array = Array(1, 2, 3); List<Integer> list = List(1, 2, 3); Stream<Integer> stream = Stream(1, 2, 3); Vector<Integer> vector = Vector(1, 2, 3);

    Tuple1<T> tuple1 = Tuple(t); Tuple3<T, U, V> tuple3 = Tuple(t, u, v); E.g. Some(1) is expected to be Option.Some, not Option. However, type narrowing is possible. // types work as expected Option<CharSeqeuence> option = Some("");

    // str might be null Option<CharSeqeuence> option = Option(str);

    // also possible, it is a Some(null)! Option<CharSeqeuence> option = Some(null);

    Uncheck Functions

    We are now able to uncheck checked functions: Function1<String, User> getUserById = CheckedFunction1.of(id -> throw new IOException()).unchecked(); // = CheckedFunction1.of(User::getById).unchecked(); It is recommended to use the API.unchecked() shortcut instead: Function1<String, User> getUserById = unchecked(id -> throw new IOException()); // = unchecked(User::getById);

    More Syntacic Sugar

    πŸ–¨ We are now able to println to console without having to type the System.out boilerplate. πŸ–¨ println("easy"); Rapid prototyping may require to defer implementations. We use TODO() for that purpose: void fancyNewAlgorithm(Arg arg) { return TODO("some fancy stuff will appear soon"); }

    fancyNewAlgorithm(TODO("need to construct the arg")); The TODO() calls will throw a NotImplementedError at runtime.

    Pattern Matching

    🐎 Internally pattern matching now uses the new PartialFunction interface, which gives a performance boost.

    Pattern Names

    We removed the possibility to create pattern matching cases outside of the pattern scope. Now we always use the existing $() methods to lift objects and functions into a pattern context.

    // beforeCase(obj, ...) // e.g. Case(1, ...)Case(predicate, ...) // e.g. Case(t -\> true, ...)// afterCase($(obj), ...) // e.g. Case($(1), ...)Case($(predicate), ...) // e.g. Case($(t -\> true), ...)
    

    Our pattern generator vavr-match follows the new naming scheme and adds a $ to all generated pattern names.

    Please prefix all patterns with $, e.g. $Some(...) instead of Some(...).

    import static io.vavr.API.\*;import static io.vavr.Patterns.\*;// same as `intOption.map(i -\> i * 2).getOrElse(-1)`String result = Match(intOption).of( Case($Some($()), i -\> i \* 2), Case($None(), -1) );
    

    More details here.

    Pre-defined Patterns

    πŸ›  Accordingly all pattern names in io.vavr.Patterns are now prefixed with a $, and

    • we replaced the List() patterns by $Cons(...) and $Nil().
    • 🚚 we removed the Stream() patterns because we need to enhance our pattern generator to express inner patterns $Stream.Cons(...) and $Stream.Empty() (API not finished).

    More details here.

    Pre-defined Predicates

    We added the predicates: exists(Predicate) forAll(Predicate) instanceOf(Class) isNotNull() isNull() More details here.

    πŸ”„ Changes to the Base Package io.vavr.control

    πŸ‘» Try keeps original Exception

    • 🚚 We removed Try.FatalException and Try.NonFatalException
    • Instead we sneaky throw the original exception when calling get() (even if it is checked!)

    πŸ‘€ For additions see the Try API.

    πŸ”„ Changes to the Collections io.vavr.collection

    • 🚚 We removed AbstractIterator from the public API
    • We changed the index type from long to int. That strikes many methods, like take(int), drop(int), zipWithIndex(), ...
    • We removed the unsafe Map.of(Object...) factory methods which interpreted the given objects as pairs.
    • We added the safe Map.of(K, V, ...) factory methods (up to 10 key/value pairs).

    Java Collection Views

    Our sequential collections, i.e. all collections that implement Seq, can be converted to a java.util collection view in O(1). 0️⃣ We provide conversion method for mutable and immutable collections. By default collections are immutable, like our persistent collections. java.util.List<Integer> list = Vector(1, 2, 3).asJava(); More examples can be found here.

    More Collections

    We completely re-implemented Vector.

    We added more collections: BitSet PriorityQueue Multimap: HashMultimap and LinkedHashMultimap SortedMultimap: TreeMultimap πŸ“„ The collections got many additions. Please check out the API docs for further details.