Created
January 11, 2019 22:15
-
-
Save creativedrewy/ea30c10e25055858c0b9cdecf7ee4e95 to your computer and use it in GitHub Desktop.
pairTo.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Combine two objects into a Pair | |
*/ | |
infix fun <A, B> A.pairTo(that: B): Pair<A, B> = Pair(this, that) | |
/** | |
* Combine three objects into a Triple (by way of one Pair and a new value) | |
*/ | |
infix fun <A, B, C> Pair<A, B>.tripleTo(that: C) = Triple(first, second, that) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment