3 ms·
True, but the constructor method is checked/validated at compile time vs. run time with the builder pattern. Not quite the same as your example, but Kotlin doe
by dangets 9y ago
True, but the constructor method is checked/validated at compile time vs. run time with the builder pattern. Not quite the same as your example, but Kotlin does have good syntax for copying data classes while only changing a single field - this could be used similar to your currying usage.
https://kotlinlang.org/docs/reference/data-classes.html#copying https://kotlinlang.org/docs/reference/data-classes.html#copy...
- guelo 9y agoHere's that kotlin copy syntax val cat = dog.copy(name = "cat")