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

org.pkl.thirdparty.paguro.tuple.package.html Maven / Gradle / Ivy

Go to download

Fat Jar containing pkl-cli, pkl-codegen-java, pkl-codegen-kotlin, pkl-config-java, pkl-core, pkl-doc, and their shaded third-party dependencies.

There is a newer version: 0.27.1
Show 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. Consider providing meaningfully named accessor methods. 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