Hacker News new | past | comments | ask | show | jobs | submit login

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#copy...




Here's that kotlin copy syntax

      val cat = dog.copy(name = "cat")




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: