Skip to content

Instantly share code, notes, and snippets.

@polyglotpiglet
Last active January 3, 2018 08:56
object Cinderella2 extends App {
def f: (Int, Vector[String]) = {
(42, Vector("Generating random int"))
}
def g(i: Int): (Int, Vector[String]) = {
(i % 2, Vector("Applying complex mathematical formula"))
}
val (i, vs1) = f
val (result, vs2) = g(i)
val printStatements = vs1 ++ vs2
println(printStatements)
println(result)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment