All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.organicdesign.fp.tuple.package.html Maven / Gradle / Ivy

Go to download

Immutable Clojure collections and a Transformation abstraction for Java 8+, immutably, type-safely, and with good performance. Name will change to "Paguro" in November 2016.

The newest version!


Immutable, type-safe, heterogeneous containers - ML calls these "records." ML, Haskell, and Scala use tuples - why not Java? Actually, tuples are *more* important in Java because Java does not have type aliases. Instead of type aliases, extend tuples to give them descriptive names, and you can give descriptive names to the accessor methods as well. Doing so is brief, ensures immutability, and provides correct, efficient equals(), hashcode(), and toString() methods.

When you are experimenting, use tuples to leverage Java's type inference engine in fluent code so that you don't need to specify any types. When you decide to keep your experiment, extend tuples to give meaningful names to your data types and their fields. Look at UsageExampleTest.java (the unit test) to see why tuples are so important and flexible.





© 2015 - 2024 Weber Informatics LLC | Privacy Policy