Skip to content

Instantly share code, notes, and snippets.

@teivah
Created October 29, 2018 21:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save teivah/6171bed18b32b96b579e6c7f73e6b6f5 to your computer and use it in GitHub Desktop.
Save teivah/6171bed18b32b96b579e6c7f73e6b6f5 to your computer and use it in GitHub Desktop.
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