Skip to content

Instantly share code, notes, and snippets.

@magdamiu
Created December 10, 2021 18:55
Embed
What would you like to do?
Pure functions | High performance with idiomatic Kotlin
class Book(val title: String, val author: String) {
// impure function
fun getBookDetails() = "$title - $author"
}
// pure function
fun getBookDetails(title: String, author: String) = "$title - $author"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment