Open kilink opened 1 year ago
Thank you. What you're asking for seems to make sense. I appreciate that you matched the code style and added unit tests. I'm sorry to take so long to even start looking at this.
I had a few nagging memories that turned out to be red herrings. The one that I'm still concerned about is type inference in Java. It should probably all be OK though. I need more time to try it out on my machine before merging, but at this point, I do plan to merge your changes.
Change the factory methods to accept a covariant type (e.g., Iterable<? extends Map.Entry>), which allows passing Iterables of UnEntry.
Note: perhaps I'm just using the library wrong, but I ran into this issue when I was attempting to merge two maps. It seemed to me that I should be able to do this:
While I know it's doable like so, to me it seems like an unnecessary limitation, and this form is more verbose:
(Would be happy to be shown a better way to merge two maps).
Another consequence of making it covariant is that you can now pass a Persistent map instance to the factory method.