Last active
March 21, 2016 00:50
-
-
Save ryandavidhartman/1e1e047fcde43bbab276 to your computer and use it in GitHub Desktop.
Different ways of defining functions in Scala
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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