Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
def foo(i: Int, f: Int => Int): Int = {
f(i)
}
def bar() = {
val increment: Int => Int = (x: Int) => x + 1
val n = foo(5, increment)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.