Skip to content

Releases: GlenKPeterson/Paguro

3.10.3: concat() and precat() (redux)

09 May 03:03
Compare
Choose a tag to compare

Release 3.10.3 2022-05-08: concat() and precat()

  • Implemented concat() and precat() methods on RrbTree and precat() on ImRrbTree and MutRrbTree
    because:
    • concat() was implemented on PersistentVector() because it's a cheap operation.
    • concat() and precat() are cheap and sensible on the RRB Tree.
  • Added a few @NotNull and @contract annotations where they were missing.

Do NOT use release 3.10.2. That was a mistake!

3.10.2: concat() and precat()

09 May 02:17
Compare
Choose a tag to compare

Release 3.10.2 2022-05-08: concat() and precat()

  • Implemented concat() and precat() methods on ImMap, MutMap, ImSet, MutSet, ImRrbTree and MutRrbTree
    because:
    • concat() was implemented on PersistentVector() because it's a cheap operation.
    • concat() and precat() are cheap and sensible on the other collection types (RRB Tree and non-sorted maps and sets)
    • Now they all return their original collection type instead of an Xform.
    • Mirko Raner (@raner) brought this to my attention in #49 - Thank you @raner!
  • Added a few @NotNull and @contract annotations where they were missing.

3.10.1 2022-03-18: NotNull whereNotNull()

18 Mar 18:23
Compare
Choose a tag to compare

Release 3.10.1 2022-03-18: NotNull whereNotNull()

  • Added @NotNull annotation to the generic type parameter returned by Transformable.whereNonNull()
    (and implementation of that method in UnmodIterable).
    • Was: @NotNull Transformable<T> whereNonNull()
    • Now: @NotNull Transformable<@NotNull T> whereNonNull()

OneOf5

21 Jan 15:59
Compare
Choose a tag to compare

Release 3.10.0 2022-01-21: "OneOf5"

  • Added OneOf5. A second-class Union Type like OneOf4, but with one more.
  • Removed OneOf2OrNone; use Option<OneOf2> instead.
    The OneOf2OrNoneTest shows how.
  • Changed the contained object in all OneOf_ classes from @Nullable to @NotNull and from private to protected.
    If you use @NotNull annotations in your subclass, you can now overload the static factory methods in your subclasses (you can use the same name for all of them).
    Instead of storing null in a OneOf_, simply return a null OneOf_ or Option<OneOf_>.none().
    The protected modifier now lets subclasses access the contained item for easily implementing an interface that the possible values share.
    The OneOf2Test shows how.
  • Test coverage reached 95% by line.

3.9.0 2021-12-30: Removed None.none()

11 Jan 16:37
Compare
Choose a tag to compare

The following are results of usage and casual code review.

Release 3.9.0 2021-12-30: Removed None.none()

  • Use Option.none() instead of None.none().
    They are duplicate methods.
    You're almost certainly going to be importing Option.some() already, so it makes sense to use Option.none() as well.
  • Fixed appendSome() to take a covariant parameter: appendSome(@NotNull Fn0<? extends @NotNull Option<E>> supplier)
  • Made RuntimeTypes store types in a Trie with node-level synchronization. The previous storage made no sense.
  • Added more nullability annotations.

Release 3.8.0 2021-12-28: BaseList.appendSome(() -> Option)

  • Replaced BaseList.appendWhen(Fn0 test, E item) with appendSome(Fn0<Option>).
    This is a better design because it can do everything the first design does, but
    allows you to avoid constructing a new E unless you need it.
  • Added more nullability annotations.
  • Tuples now have a private static final long serialVersionUID field.
    This was always intended to be there
    (so you can serialize with one version of Paguro and deserialize with another)
    but was generated as part of comment by accident.
    This field will not change so long as tuples do not change in a way that affects their serialization.

3.7.2 2021-12-20: Fixed RrbTree

24 Dec 15:35
Compare
Choose a tag to compare

Release 3.7.2 2021-12-20: Fix RrbTree.split()

  • Fixed Bug #47: "RrbTree.split() returns wrong type" and added test to prevent regressions.
    Thank you, @fcurts, for reporting this!

Release 3.7.1 2021-12-20

  • Added BaseList.appendWhen() for fluent list building with optional additions.

Release 3.7.0 2021-12-19

  • RRB Tree .join() method appears to work after removing strict-node optimization.
    Many thanks to hours of conversations with Andy Fingerhut @jafingerhut and for his
    great unit tests and fixes. Without his help, this would not have happened.
    Choose wisely based on your write operations: If you're only doing appends, use PersistentVector as it's more efficient.
    Inserts or joins, use RRB-Tree.
  • PersistentVector.MutVector.replace() now works thanks to a bug report and unit test
    from Axel Kramer @axkr. The persistent version was unaffected by this issue.
  • Added more @NotNull annotations, though there are still many more to add.

Release 3.6.0 2021-09-21

  • Added back .add() and .addAll() methods to MutList.
    This is sort of an experiment to see if this is more helpful than dangerous.
    It's probably helpful, but I can't do this with all the appropriate methods/interfaces right now.
  • Made project Eclipse 1.0 by default, some files available Apache 2.0 if you want.
    This is not a big change from what it was before and probably only affects forks,
    or people just using a few files or code snippets.

Nullability bug fix

07 Dec 22:45
Compare
Choose a tag to compare

Fixed some nullability annotations in StaticImports to work with Kotlin 1.4.21.

Still waiting on this to appear on maven central... they are slow right now.

Kotlin-Friendly

06 Oct 20:17
Compare
Choose a tag to compare

Release 3.5.8 2020-10-06

  • Renamed all mutable collections from Mutable___ to Mut___ so they no longer conflict with Kotlin's StdLib. See script below to help you upgrade.
  • Deprecated RRB-Tree join() and remove() methods until the bugs in them can be fixed.
  • Added org.jetbrains.annotations dependency and marked many methods with Nullable and NotNull.
    This increased the size of the jar file by less than 3%.
  • Use filterNonNull() Instead of .filter(Objects::nonNull) because sometimes IntelliJ gets confused about whether objects can be null in this case or not.
  • Fixed some nullability issues with the few varargs methods in this project.
  • Added Transform.any(Fn1) which returns true if anything matches the given predicate.

Here is a script to ease your upgrade from 3.0 or 3.2 to 3.5

# USE CAUTION AND HAVE A BACKUP OF YOUR SOURCE CODE (VERSION CONTROL) - NO GUARANTEES

oldString='MutableList'
newString=MutList
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)

oldString='MutableMap'
newString=MutMap
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)

oldString='MutableSet'
newString=MutSet
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)

oldString='toMutableSortedSet'
newString=toMutSortedSet
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)

oldString='toMutableSortedMap'
newString=toMutSortedMap
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)

oldString='MutableHashSet'
newString=MutHashSet
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)

oldString='MutableHashMap'
newString=MutHashMap
sed -i -e "s/$oldString/$newString/g" $(fgrep --exclude-dir='.svn' --exclude-dir='.git' -rIl "$oldString" *)

After the above, you probably want to check out any Kotlin files. Sorry. If you use MutableMap/MutableList/etc. inside a Kotlin file, you have to fix it manually. Sorry.

IllegalStateException

05 Jul 23:47
Compare
Choose a tag to compare
  • Merged kmark's changes to ues IllegalStateException (extends RuntimeException) instead of IllegalAccessError (extends Error) in PersistentHashMap.
    IllegalAccessError was a holdover from the original Clojure source code and may have made sense in an earlier Java version, but IllegalStateException is a better choice today.
    Thank you, Kevin!
  • Updated test and plugin dependencies
  • Compiled with Java 11 (hence updating middle version number).
  • Fixed warnings

3.1.2: Heterogeneous RrbTree Fix

18 Jan 01:34
Compare
Choose a tag to compare
  • Fixed a bug (reported by fcurts - with unit test!) where Heterogeneous RrbTrees of more than 32 items
    would throw an exception at Runtime.
  • Documented Cowry (Copy-On Write aRraY) better.
  • Updated version number past 3.1.1 which conflicted with the Kotlin-Friendly branch. Kotlin-Friendly Paguro is now called Paguro-KF and starts with version 3.5.x.