Skip to content

Instantly share code, notes, and snippets.

@ryandavidhartman
Last active March 21, 2016 00:50
Show Gist options
  • Save ryandavidhartman/1e1e047fcde43bbab276 to your computer and use it in GitHub Desktop.
Save ryandavidhartman/1e1e047fcde43bbab276 to your computer and use it in GitHub Desktop.
Different ways of defining functions in Scala
def f1(x: Int): Int = x*x
val f2 = (x: Int) => x*x
def f3 = (x: Int) => x*x
def f4:(Int => Int) = x => x*x
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment