A Tuples implementation in Kotlin.
A tuple is a finite, heterogeneous, ordered series of elements.
A few years ago, while learning Java/Android, I was introduced to the original JavaTuples library - a simple, elegant library for creating and working with tuples.
This project implements similar functionality in Kotlin, using Kotlin-esque semantics. Also, it more closely follows ordinal (as opposed to index-based) semantics in certain circumstances, where it seems appropriate.
Some examples:
Elementclass vsUnitclass (to avoid confusion withUnitin Kotlin)tripletOf(a, b, c)vsTriplet.with(a, b, c)myTuple.firstvsmyTuple.getValue0()myOtherTuple.dropSecond()vsmyOtherTuple.removeFrom1()
This project (like all of my personal projects, really) exists mainly to give me a playground in which to experiment. Should you find it useful, drop me a line. I'd be very happy to hear about how you use it!
- Finish this README.
- Add KDocs for each of the Tuple classes.
- Add homogenous Tuple implementation?
- Add
HenDecadeandDozenclasses? - Rename
EnneadtoNonet?